Commits

Marko Mrdjenovic committed b1f099a

InvitationBackend needs to return False in registration_allowed when invitation key not provided

Comments (0)

Files changed (1)

registration/backends/invitational/__init__.py

         """
         if not getattr(settings, 'REGISTRATION_OPEN', False):
             try:
-                invite = invitation_model_class.objects.get(invitation_key=request.GET.get("invitation_key"))
-                return True
+                if request.GET.get("invitation_key"):
+                    invite = invitation_model_class.objects.get(invitation_key=request.GET.get("invitation_key"))
+                    return True
+                else:
+                    return False
             except invitation_model_class.DoesNotExist:
                 return False
         return True