equal
deleted
inserted
replaced
136 params = dicts.merge(params, self._params) |
136 params = dicts.merge(params, self._params) |
137 |
137 |
138 try: |
138 try: |
139 access.checkAccess('editSelf', request, params['rights']) |
139 access.checkAccess('editSelf', request, params['rights']) |
140 except out_of_band.Error, error: |
140 except out_of_band.Error, error: |
141 return error.response(request, template=self.EDIT_SELF_TMPL) |
141 return helper.responses.errorResponse(error, request, |
|
142 template=self.EDIT_SELF_TMPL) |
142 |
143 |
143 account = users.get_current_user() |
144 account = users.get_current_user() |
144 properties = {'account': account} |
145 properties = {'account': account} |
145 |
146 |
146 user = soc.logic.models.user.logic.getForFields(properties, unique=True) |
147 user = soc.logic.models.user.logic.getForFields(properties, unique=True) |
163 # if it is show error message that account is invalid |
164 # if it is show error message that account is invalid |
164 if soc.logic.models.user.logic.isFormerAccount(account): |
165 if soc.logic.models.user.logic.isFormerAccount(account): |
165 msg = self.DEF_USER_ACCOUNT_INVALID_MSG_FMT % { |
166 msg = self.DEF_USER_ACCOUNT_INVALID_MSG_FMT % { |
166 'email': account.email()} |
167 'email': account.email()} |
167 error = out_of_band.Error(msg) |
168 error = out_of_band.Error(msg) |
168 return error.response(request, template=self.EDIT_SELF_TMPL, |
169 return helper.responses.errorResponse( |
169 context=context) |
170 error, request, template=self.EDIT_SELF_TMPL, context=context) |
170 |
171 |
171 user = soc.logic.models.user.logic.updateOrCreateFromFields( |
172 user = soc.logic.models.user.logic.updateOrCreateFromFields( |
172 properties, {'link_id': new_link_id}) |
173 properties, {'link_id': new_link_id}) |
173 |
174 |
174 # redirect to /user/profile?s=0 |
175 # redirect to /user/profile?s=0 |