Commit 6e020e3c authored by Maël Kervella's avatar Maël Kervella Committed by Pierre Cadart

Vérifie que le content_type existe dans un objet Revision

Prévient le cas d'un objet delete mais sans revert l'action
parent 357b794f
......@@ -74,7 +74,15 @@ def index(request):
reversions = []
for revision in revisions :
for reversion in revision.version_set.all() :
if in ['ban', 'whitelist', 'vente', 'cotisation', 'interface', 'user'] :
content = ''
try :
content =
except :
# If reversion has no content_type (when object has been deleted)
if content in ['ban', 'whitelist', 'vente', 'cotisation', 'interface', 'user'] :
{'id' :,
'datetime': revision.date_created.strftime('%d/%m/%y %H:%M:%S'),
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment