8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-16 08:23:12 +00:00

[Printer][re2o] Allow to disable printer directly from 'Preference' menu

This commit is contained in:
Maxime Bombar 2018-10-20 15:59:41 +02:00 committed by root
parent 6e7c3bfc55
commit c431771b93

View file

@ -27,7 +27,7 @@ import datetime
from django.contrib import messages
from django.http import HttpRequest
from preferences.models import GeneralOption, OptionalMachine
from preferences.models import GeneralOption, OptionalMachine, OptionalPrinter
from django.utils.translation import get_language
from re2o.settings import INSTALLED_APPS
@ -70,7 +70,8 @@ def context_printer(request):
"""
Useful to know whether the printer app is activated or not
"""
printer = 'printer' in INSTALLED_APPS
printerSettings = OptionalPrinter.objects.get()
printer = ('printer' in INSTALLED_APPS) and printerSettings.Printer_enabled
return {
'printer': printer,
}