From 10f24f4591d9d563bb30d06805c7ab4a77edf98f Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Sat, 27 Oct 2018 04:45:28 +0200 Subject: [PATCH] Cree l'objet pref printer si il n'existe pas --- printer/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer/settings.py b/printer/settings.py index b47ef6cb..b8eea322 100644 --- a/printer/settings.py +++ b/printer/settings.py @@ -4,7 +4,7 @@ Define variables used in printer app from django.utils.translation import ugettext_lazy as _ from preferences.models import OptionalPrinter -settings = OptionalPrinter.objects.get() +settings, created = OptionalPrinter.objects.get_or_create() MAX_PRINTFILE_SIZE = settings.max_size * 1024 * 1024 # 25 MB ALLOWED_TYPES = ['application/pdf']