During development apps and models permissions are sometimes removed or renamed. What\'s a good way to clean the leftovers from the permissions table without breaking someth
Short answer: register the Permission with the admin site. add this to your admin.py file:
from django.contrib.auth.models import Permission
admin.site.register(Permission)
Then you control everything from there.
Long answer: Permission are objects, just like everything else in django. They are saved into the database, and linked linked to users and groups through a ManyToMany relationship. When you simply changed the name of the permission in the Meta class of the Article model, django had no way of knowing that you still ment the same object as before, so instead it created a new one.
What you should've done was, after changing the name of the permission in the model was to also change the name of the correlating permission object in your database.
The easiest way to do this is to register the Permission object with the admin site, so you'd have control from there. You'd still need to change it in both places (models.py and your DB) for any name change, but the admin site makes this easier.
Keep in mind that the extra Permission object you created ('update') has a new pk, meaning that if you just delete your older Permission object ('edit') it would have consequences on anything it had a relation with. If you have data that you don't want to lose I suggest writing a script to merge the two Permission objects to avoid any errors