Skip to content

Commit

Permalink
Fixed invalid signup code case to notify in all cases
Browse files Browse the repository at this point in the history
When a signup code is invalid we will now issue a user message regardless of
the value for ACCOUNT_OPEN_SIGNUP.
  • Loading branch information
brosner committed Feb 14, 2013
1 parent 2939564 commit dfa8011
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions account/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit dfa8011

Please sign in to comment.