Permalink
Browse files

Fixed invalid signup code case to notify in all cases

When a signup code is invalid we will now issue a user message regardless of
the value for ACCOUNT_OPEN_SIGNUP.
  • Loading branch information...
1 parent 2939564 commit dfa8011e7fecedea6b7cab4c8f0bf996f1c42142 @brosner brosner committed Feb 14, 2013
Showing with 9 additions and 12 deletions.
  1. +9 −12 account/views.py
View
@@ -185,18 +185,15 @@ def is_open(self):
try:
self.signup_code = SignupCode.check(code)
except SignupCode.InvalidCode:
- if not settings.ACCOUNT_OPEN_SIGNUP:
- return False
- else:
- if self.messages.get("invalid_signup_code"):
- messages.add_message(
- self.request,
- self.messages["invalid_signup_code"]["level"],
- self.messages["invalid_signup_code"]["text"] % {
- "code": code
- }
- )
- return True
+ if self.messages.get("invalid_signup_code"):
+ messages.add_message(
+ self.request,
+ self.messages["invalid_signup_code"]["level"],
+ self.messages["invalid_signup_code"]["text"] % {
+ "code": code
+ }
+ )
+ return settings.ACCOUNT_OPEN_SIGNUP
else:
return True
else:

0 comments on commit dfa8011

Please sign in to comment.