summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--example_project/settings.py2
-rw-r--r--ishtar_common/models_common.py3
-rw-r--r--ishtar_common/views.py3
3 files changed, 5 insertions, 3 deletions
diff --git a/example_project/settings.py b/example_project/settings.py
index 726ccda8e..66b429bab 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -270,7 +270,7 @@ LIBREOFFICE_HOST = "localhost"
ISHTAR_MAP_MAX_ITEMS = 50000
ISHTAR_QRCODE_VERSION = 6 # density of the QR code
-ISHTAR_QRCODE_SCALE = 2 # scale of the QR code
+ISHTAR_QRCODE_SCALE = 5 # scale of the QR code
ISHTAR_DEFAULT_YEAR = 1900
ISHTAR_SLUGS = {
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 9f5be1e36..c623a0604 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -4453,7 +4453,8 @@ class CompleteIdentifierItem(models.Model, ImageContainerModel):
@property
def qrcode_path(self):
- if not self.qrcode:
+ if not self.qrcode or (
+ self.qrcode.path and not os.path.exists(self.qrcode.path)):
self.generate_qrcode()
if not self.qrcode: # error on qrcode generation
return ""
diff --git a/ishtar_common/views.py b/ishtar_common/views.py
index a2e6658dd..29e7e5fe5 100644
--- a/ishtar_common/views.py
+++ b/ishtar_common/views.py
@@ -1496,7 +1496,8 @@ class QRCodeView(DynamicModelView, IshtarMixin, LoginRequiredMixin, View):
if not hasattr(item, "qrcode"):
raise Http404()
- if not item.qrcode or not item.qrcode.name:
+ if not item.qrcode or not item.qrcode.name or not os.path.exists(
+ item.qrcode.path):
item.generate_qrcode(request=self.request)
if not item.qrcode or not item.qrcode.name: # generation has failed