apps: retire la journalisation explicite par modification du formulaire d'édition des agents (fixes #17571)
This commit is contained in:
parent
cdb4ef5e9d
commit
8f070b81fd
|
@ -156,16 +156,6 @@ class AppConfig(django.apps.AppConfig):
|
|||
del form.fields[field_name]
|
||||
form.fields['email'].required = True
|
||||
|
||||
def generate_new_edit_save(old_save):
|
||||
def edit_save(*args, **kwargs):
|
||||
response = old_save(*args, **kwargs)
|
||||
models.Journal.objects.create(
|
||||
actor=form.request.user,
|
||||
subject=form.instance,
|
||||
message='modification des données')
|
||||
return response
|
||||
return edit_save
|
||||
form.save = generate_new_edit_save(form.save)
|
||||
# Si un compte est validé, on interdit la modification des attributs coeurs
|
||||
if form.instance.attributes.validated:
|
||||
for field_name in form.fields:
|
||||
|
|
Loading…
Reference in New Issue