153 def _editPost(self, request, entity, fields): |
153 def _editPost(self, request, entity, fields): |
154 """See base.View._editPost(). |
154 """See base.View._editPost(). |
155 """ |
155 """ |
156 |
156 |
157 # fill in the account field with the current User |
157 # fill in the account field with the current User |
158 fields['account'] = users.User() |
158 fields['account'] = users.User() |
|
159 |
|
160 # special actions if there is no ToS present |
|
161 s_logic = model_logic.site.logic |
|
162 site_tos = s_logic.getToS(s_logic.getSingleton()) |
|
163 if not site_tos: |
|
164 # there is no Terms of Service set |
|
165 if not entity: |
|
166 # we are a new user so set the agrees_to_tos field to None |
|
167 fields['agrees_to_tos'] = None |
|
168 else: |
|
169 # editing an existing user so don't change the agrees_to_tos field |
|
170 fields['agrees_to_tos'] = entity.agrees_to_tos |
159 |
171 |
160 super(View, self)._editPost(request, entity, fields) |
172 super(View, self)._editPost(request, entity, fields) |
161 |
173 |
162 |
174 |
163 def getSidebarMenus(self, id, user, params=None): |
175 def getSidebarMenus(self, id, user, params=None): |