O
O
Ozrae2020-02-03 10:47:49
Django
Ozrae, 2020-02-03 10:47:49

What should I do if I accidentally deleted an object from the site?

I am now at the stage of studying the authentication system and a question has arisen. Let's say the admin accidentally deleted the desired object, or the moderator did it, or the moderator turned out to be an asshole and started deleting everything from the site. What to do in such cases?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2020-02-03
@Ozrae

Let's say the admin accidentally deleted the desired object, or the moderator did it, or the moderator turned out to be an asshole and started deleting everything from the site. What to do in such cases?

Backups, do in advance.
You can implement soft deletion, i.e. objects will be marked in the database as deleted.
In this case, the data itself will not go anywhere.
https://adriennedomingus.com/blog/soft-deletion-in... Have
a look at this library:
https://github.com/scoursen/django-softdelete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question