app/soc/logic/cleaning.py
changeset 1522 983b126f5aca
parent 1472 27c9ae3f8d8b
child 1621 106a5a7834d0
equal deleted inserted replaced
1521:bb086732bf7f 1522:983b126f5aca
   220   """Returns the User with the given field_name value.
   220   """Returns the User with the given field_name value.
   221   """
   221   """
   222 
   222 
   223   @check_field_is_empty(field_name)
   223   @check_field_is_empty(field_name)
   224   def wrapped(self):
   224   def wrapped(self):
   225     email_adress = self.cleaned_data.get(field_name).lower()
   225     email_adress = self.cleaned_data[field_name]
   226 
   226     return users.User(email_adress)
   227     # get the user account for this email
   227 
   228     user_account = users.User(email_adress)
       
   229 
       
   230     return user_account
       
   231   return wrapped
   228   return wrapped
   232 
   229 
   233 
   230 
   234 def clean_user_account_not_in_use(field_name):
   231 def clean_user_account_not_in_use(field_name):
   235   """Check if the field_name value contains an email 
   232   """Check if the field_name value contains an email