In puzzle_editing/views.py:
@login_required
def oauth2_link(request):
(...)
# if 'state' in request.GET and 'session' in request.session and request.GET['state'] == request.session['discord_state']:
# handles the discord oauth_callback
del request.session["discord_state"]
It looks like half the code was commented out with a typo in it (it should be 'discord_state' instead of 'session'), and as a result, the del throws an exception if discord_state is not in request session. I think it should be:
# handles the discord oauth_callback
if 'state' in request.GET and 'discord_state' in request.session and request.GET['state'] == request.session['discord_state']:
del request.session["discord_state"]
In puzzle_editing/views.py:
It looks like half the code was commented out with a typo in it (it should be 'discord_state' instead of 'session'), and as a result, the del throws an exception if discord_state is not in request session. I think it should be: