Commits

Josh Ourisman committed a5989d3

properly handling case of not having UNLIMITED_INVITATIONS setting

Comments (0)

Files changed (1)

invitation/views.py

     remaining_invitations = remaining_invitations_for_user(request.user)
     if request.method == 'POST':
         form = form_class(data=request.POST, files=request.FILES)
-        if (settings.UNLIMITED_INVITATIONS or remaining_invitations > 0) \
+        unlimited_invitations = getattr(settings, 'UNLIMITED_INVITATIONS', False)
+        if (unlimited_invitations or remaining_invitations > 0) \
                 and form.is_valid():
             invitation = InvitationKey.objects.create_invitation(request.user)
             invitation.send_to(form.cleaned_data["email"])