Routeur: Ajout temporaire des modules workflow et dae en écriture
[auf_rh_dae.git] / src / auf.django.metadata / auf / django / metadata / admin.py
index 3868c27..2b6f77c 100755 (executable)
@@ -1,25 +1,17 @@
 # -*- encoding: utf-8 -*-
 
 import datetime
-from django.contrib import admin
-from django.contrib import messages
-from django.shortcuts import redirect
-from models import AUFMetadata
 
 AUF_METADATA_READONLY_FIELDS = ('supprime',
                        'date_creation',
                        'user_creation',
                        'date_modification',
                        'user_modification',
-                       'date_activation',
-                       'user_activation',
-                       'date_desactivation',
-                       'user_desactivation', )
+                        )
 
 AUF_METADATA_FIELDSET_FIELDS = ('date_creation', 'user_creation',
                        'date_modification', 'user_modification',
-                       'date_activation', 'user_activation',
-                       'date_desactivation', 'user_desactivation',)
+                        )
 
 class AUFMetadataInlineAdminMixin(object):
     exclude = AUF_METADATA_READONLY_FIELDS
@@ -43,14 +35,6 @@ class AUFMetadataAdminMixin(object):
             obj.date_creation = datetime.datetime.now()
         obj.user_modification = request.user
         obj.date_modification = datetime.datetime.now()
-        initial = getattr(form, 'initial', None)
-        if initial:
-            if form.initial['actif'] is True and obj.actif is False:
-                obj.user_desactivation = request.user
-                obj.date_desactivation = datetime.datetime.now()
-            if form.initial['actif'] is False and obj.actif is True:
-                obj.user_activation = request.user
-                obj.date_activation = datetime.datetime.now()
         obj.save()
 
     def has_metadata(self, instance):