Commits

George Notaras committed 627a1d3

Fixed the order of attribute modifications for databases

Comments (0)

Files changed (1)

src/PostgreSQL_manager/admin.py

         
         else:   # This is the change form
             
+            if 'name' in form.changed_data:
+                PgDatabase.objects.rename_database(form.initial['name'], obj.name)
+            
             if 'owner' in form.changed_data:
                 PgDatabase.objects.set_owner(obj.name, obj.owner)
             
             if 'connlimit' in form.changed_data:
                 PgDatabase.objects.limit_connections(obj.name, obj.connlimit)
-            
-            if 'name' in form.changed_data:
-                PgDatabase.objects.rename_database(form.initial['name'], obj.name)
                 
         # Save the model
         obj.save()