app/soc/logic/models/user.py
changeset 1161 ad352f3a37d3
parent 1115 0a723ff3d27c
child 1192 b53fa1e05dbd
--- a/app/soc/logic/models/user.py	Sun Feb 01 17:40:26 2009 +0000
+++ b/app/soc/logic/models/user.py	Sun Feb 01 17:52:12 2009 +0000
@@ -134,8 +134,18 @@
     with the old account.
     Also, if either is_developer or agrees_to_tos change, the user's
     rights have changed, so we need to flush the sidebar.
+    Make sure once the user agreed ToS, the ToS fields can't be changed.
     """
 
+    # iff the agreed_to_tos is True and we want to set it to False 
+    if (name == 'agreed_to_tos') and (not value) and entity.agreed_to_tos:
+      return False
+
+    # iff the agreed_to_tos_on has a value and we want to change it
+    if (name == 'agreed_to_tos_on') and entity.agreed_to_tos_on and (
+        value != entity.agreed_to_tos_on):
+      return False
+
     if (name == 'is_developer') and (entity.is_developer != value):
       sidebar.flush(entity.account)