app/soc/logic/models/user.py
changeset 1517 a467d13e34ea
parent 1479 bc738f92a4d8
child 1521 bb086732bf7f
equal deleted inserted replaced
1516:8df06dc877aa 1517:a467d13e34ea
   127     """See base.Logic.getKeyFieldNames.
   127     """See base.Logic.getKeyFieldNames.
   128     """
   128     """
   129 
   129 
   130     return ['link_id']
   130     return ['link_id']
   131 
   131 
   132   def _updateField(self, entity, name, value):
   132   def _updateField(self, entity, entity_properties, name):
   133     """Special case logic for account.
   133     """Special case logic for account.
   134 
   134 
   135     When the account is changed, the former_accounts field should be appended
   135     When the account is changed, the former_accounts field should be appended
   136     with the old account.
   136     with the old account.
   137     Also, if either is_developer or agrees_to_tos change, the user's
   137     Also, if either is_developer or agrees_to_tos change, the user's
   138     rights have changed, so we need to flush the sidebar.
   138     rights have changed, so we need to flush the sidebar.
   139     Make sure once the user agreed ToS, the ToS fields can't be changed.
   139     Make sure once the user agreed ToS, the ToS fields can't be changed.
   140     """
   140     """
       
   141 
       
   142     value = entity_properties[name]
   141 
   143 
   142     # iff the agreed_to_tos is True and we want to set it to False 
   144     # iff the agreed_to_tos is True and we want to set it to False 
   143     if (name == 'agreed_to_tos') and (not value) and entity.agreed_to_tos:
   145     if (name == 'agreed_to_tos') and (not value) and entity.agreed_to_tos:
   144       return False
   146       return False
   145 
   147