mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-01 09:02:26 +00:00
[Printer][re2o] Allow to disable printer directly from 'Preference' menu
This commit is contained in:
parent
6e7c3bfc55
commit
c431771b93
1 changed files with 3 additions and 2 deletions
|
@ -27,7 +27,7 @@ import datetime
|
||||||
|
|
||||||
from django.contrib import messages
|
from django.contrib import messages
|
||||||
from django.http import HttpRequest
|
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 django.utils.translation import get_language
|
||||||
|
|
||||||
from re2o.settings import INSTALLED_APPS
|
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
|
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 {
|
return {
|
||||||
'printer': printer,
|
'printer': printer,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue