File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -315,6 +315,7 @@ class WarningAnnouncement(models.Model):
315315 ("login" , "Login Warning (displays on login page)" ),
316316 ("dashboard_login" , "Dashboard and Login Warning (displays on dashboard and login pages)" ),
317317 ("global" , "Global Warning (displays on all pages)" ),
318+ ("printing" , "Printing Warning (displays on printing page)" ),
318319 ],
319320 default = "dashboard" ,
320321 )
Original file line number Diff line number Diff line change 2020from sentry_sdk import add_breadcrumb , capture_exception
2121from xhtml2pdf import pisa
2222
23+ from ...utils .helpers import get_warning_html
24+ from ..announcements .models import WarningAnnouncement
2325from ..auth .decorators import deny_restricted
2426from ..context_processors import _get_current_ip
2527from .forms import PrintJobForm
@@ -548,7 +550,7 @@ def print_view(request):
548550 start_time = datetime .datetime .now () - datetime .timedelta (seconds = elapsed_seconds )
549551 context ["updated_time" ] = start_time .strftime ("%-I:%M:%S %p" )
550552
551- if ( printing_warning_objs := WarningAnnouncement .objects .filter (type = "printing" , active = True ) ):
553+ if printing_warning_objs := WarningAnnouncement .objects .filter (type = "printing" , active = True ):
552554 context ["printing_warning" ] = get_warning_html (printing_warning_objs )
553555
554556 return render (request , "printing/print.html" , context )
Original file line number Diff line number Diff line change 6363
6464{% block main %}
6565 < div class ="primary-content ">
66+ {% if printing_warning %}
67+ < div class ="warning-announcement "> {{ printing_warning|safe|linebreaks }}</ div >
68+ {% endif %}
6669
6770 < h2 > Printing</ h2 >
6871 < br >
You can’t perform that action at this time.
0 commit comments