Пример #1
0
 def setup_signup_code(self):
     code = self.get_code()
     if code:
         try:
             self.signup_code = SignupCode.check_code(code)
         except SignupCode.InvalidCode:
             self.signup_code = None
         self.signup_code_present = True
     else:
         self.signup_code = None
         self.signup_code_present = False
Пример #2
0
 def setup_signup_code(self):
     code = self.get_code()
     if code:
         try:
             self.signup_code = SignupCode.check_code(code)
         except SignupCode.InvalidCode:
             self.signup_code = None
         self.signup_code_present = True
     else:
         self.signup_code = None
         self.signup_code_present = False
Пример #3
0
 def is_open(self):
     code = self.request.REQUEST.get("code")
     if code:
         try:
             self.signup_code = SignupCode.check_code(code)
         except SignupCode.InvalidCode:
             if self.messages.get("invalid_signup_code"):
                 messages.add_message(
                     self.request,
                     self.messages["invalid_signup_code"]["level"],
                     self.messages["invalid_signup_code"]["text"].format(
                         **{"code": code}))
             return settings.ACCOUNT_OPEN_SIGNUP
         else:
             return True
     else:
         return settings.ACCOUNT_OPEN_SIGNUP
Пример #4
0
 def is_open(self):
     code = self.request.REQUEST.get("code")
     if code:
         try:
             self.signup_code = SignupCode.check_code(code)
         except SignupCode.InvalidCode:
             if self.messages.get("invalid_signup_code"):
                 messages.add_message(
                     self.request,
                     self.messages["invalid_signup_code"]["level"],
                     self.messages["invalid_signup_code"]["text"].format(**{
                         "code": code
                     })
                 )
             return settings.ACCOUNT_OPEN_SIGNUP
         else:
             return True
     else:
         return settings.ACCOUNT_OPEN_SIGNUP