Django how to save object status in signals?

I am using signals in my model. The status of blog post will be pending for admin approval when any user try to edit existing blog post. But when I trying to change status from pending to published from my admin panel, it’s keeping the old status “pending” . How to change new status from admin panel? here is my code:

def post_update(sender,instance,*args,**kwargs):
           if instance:
               instance = Blog.objects.filter(is_published="published").update(is_published="pending")



How do you know when the model can actually be published? It sounds like it’s based on the saving user’s credentials. If that’s the case, if you have a ForeignKey on Blog to User for whichever user saved updated it, you could check to see if they are admin or staff, then perform the update. The difficulty here is that this signal is raised whenever the blog is saved, so an admin editing a blog post could potentially bypass the review.

If the above changes your data model too much for your tastes, you may want to consider setting is_published to "pending" in your application where you save the model and remove this signal handler. Without additional context, that handler isn’t going to be able to determine when it should be published or pending.