From f06622218b1ef122da9e79875304e2098f1908d5 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Wed, 17 Jul 2019 13:27:08 +0200 Subject: [PATCH] Check image revision_number before string format due to "'revision_number' cannot be null" #950 --- src/wiki/plugins/images/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wiki/plugins/images/models.py b/src/wiki/plugins/images/models.py index f25ca1ed..b57dd0a0 100644 --- a/src/wiki/plugins/images/models.py +++ b/src/wiki/plugins/images/models.py @@ -101,7 +101,10 @@ class ImageRevision(RevisionPluginRevision): ordering = ('-created',) def __str__(self): - return gettext('Image Revision: %d') % self.revision_number + if self.revision_number: + return gettext('Image Revision: %d') % self.revision_number + else: + return gettext('Current revision not set!!') def on_image_revision_delete(instance, *args, **kwargs): -- 2.45.2