I am trying to make a mixin that I have written a little more pythonic, but I have run into a problem.
The original code that works perfectly, is:
if referring_page == 'register':
return allow
elif referring_class == 'EmailVerificationCode':
return allow
elif referring_class == 'EmailVerification':
return allow
else:
return redirect('account:verify_email')
Which I changed to:
if referring_page in {'register', 'EmailVerification', 'EmailVerificationCode'}:
return allow
else:
return redirect('account:verify_email')
Which for some reason doesn’t work, what am I missing?