Commits

George Notaras committed 3960b4e

Fixed the order of attribute modifications

Comments (0)

Files changed (1)

src/PostgreSQL_manager/admin.py

             
         else:   # This is the change form
             
+            if 'name' in form.changed_data:
+                PgUser.objects.rename_role(form.initial['name'], obj.name)
+            
             if 'connlimit' in form.changed_data:
                 PgUser.objects.limit_connections(obj.name, obj.connlimit)
             
             
             if password:
                 PgUser.objects.change_password(obj.name, password)
-            
-            if 'name' in form.changed_data:
-                PgUser.objects.rename_role(form.initial['name'], obj.name)
  
         # Save the model
         obj.save()