Revision e8b79d7d
Added by Thomas Noël about 13 years ago
extra/modules/ezldap_ui.ptl | ||
---|---|---|
142 | 142 |
if form.get_submit() == 'cancel': |
143 | 143 |
return redirect('.') |
144 | 144 |
if form.is_submitted() and not form.has_errors(): |
145 |
user = get_request().user |
|
146 | 145 |
self.remove_email_submit() |
147 | 146 |
template.html_top(_('Removing Account')) |
148 | 147 |
TextsDirectory.get_html_text('remove-token-sent') % { 'email': user.email } |
... | ... | |
231 | 230 |
return TextsDirectory.get_html_text('new-password-sent-by-email') |
232 | 231 |
elif action == 'remove': |
233 | 232 |
template.html_top(_('Removing Account')) |
233 |
# delete all related forms |
|
234 |
formdefs = FormDef.select() |
|
235 |
user_forms = [] |
|
236 |
for formdef in formdefs: |
|
237 |
user_forms.extend(formdef.data_class().get_with_indexed_value('user_id', dn)) |
|
238 |
for formdata in user_forms: |
|
239 |
formdata.remove_self() |
|
240 |
# delete the user in ldap |
|
234 | 241 |
ezldap.get_ldap_conn().delete_s(dn) |
235 | 242 |
# FIXME : hack for vincennes only... |
236 | 243 |
return redirect('../../logout') |
Also available in: Unified diff
[ezldap] delete forms when delete an account
fix #619