Skip to content

Commit

Permalink
fix: template base_context for custom messages
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Nov 23, 2022
1 parent f37c703 commit d004024
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions uniticket/uni_ticket/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
logger = logging.getLogger(__name__)


def base_context(context):
context['base_template'] = getattr(settings,
'DEFAULT_BASE_TEMPLATE',
'')
return context


def compress_text_to_b64(text):
"""Returns a compressed and b64 encoded string"""
if isinstance(text, str):
Expand All @@ -65,7 +72,7 @@ def custom_message(request, message="", structure_slug="", status=None):
return render(
request,
"custom_message.html",
{"avviso": message, "structure_slug": structure_slug},
base_context({"avviso": message, "structure_slug": structure_slug}),
status=status,
)

Expand Down Expand Up @@ -636,11 +643,6 @@ def export_category_zip(category, ticket_codes_list=[]):
)
return response

def base_context(context):
context['base_template'] = getattr(settings,
'DEFAULT_BASE_TEMPLATE',
'')
return context

def redirect_after_login(fullpath):
_sep = "?"
Expand Down

0 comments on commit d004024

Please sign in to comment.