mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-24 20:33:11 +00:00
Fix chargement du réglage printer
This commit is contained in:
parent
c6adb87e4b
commit
2c849c7064
3 changed files with 5 additions and 4 deletions
|
@ -27,6 +27,8 @@ from .validators import (
|
|||
FileValidator,
|
||||
)
|
||||
|
||||
from preferences.models import OptionalPrinter
|
||||
|
||||
from .settings import (
|
||||
MAX_PRINTFILE_SIZE,
|
||||
ALLOWED_TYPES,
|
||||
|
@ -65,7 +67,8 @@ class Digicode(RevMixin, models.Model, AclMixin, FieldPermissionModelMixin):
|
|||
|
||||
@classmethod
|
||||
def active_codes(cls):
|
||||
return cls.objects.filter(created__gte = timezone.now() - datetime.timedelta(days=3))
|
||||
code_duration = OptionalPrinter.get_cached_value('code_duration')
|
||||
return cls.objects.filter(created__gte = timezone.now() - code_duration)
|
||||
|
||||
def _gen_code(user):
|
||||
try_again = True
|
||||
|
|
|
@ -16,8 +16,7 @@ def printer_enabled():
|
|||
"""
|
||||
Check whether the printer is enabled or not
|
||||
"""
|
||||
settings, created = OptionalPrinter.objects.get_or_create()
|
||||
return settings.Printer_enabled
|
||||
return OptionalPrinter.get_cached_value('Printer_enabled')
|
||||
|
||||
|
||||
def pdfinfo(file_path):
|
||||
|
|
|
@ -19,7 +19,6 @@ from re2o.base import (
|
|||
re2o_paginator,
|
||||
SortTable
|
||||
)
|
||||
from . import settings
|
||||
|
||||
from .utils import pdfinfo, send_mail_printer, printer_enabled
|
||||
|
||||
|
|
Loading…
Reference in a new issue