feat: Allow undefined texts

This commit is contained in:
moanos [he/him] 2024-04-14 13:37:51 +02:00
parent 505b2255cc
commit 2d86292d66

View File

@ -103,9 +103,16 @@ def about(request):
lang = request.user.member.preferred_language
else:
lang = Language.objects.get(languagecode="de")
try:
terms_of_service = Text.objects.get(text_code="terms_of_service", language=lang)
except Text.DoesNotExist:
terms_of_service = None
try:
imprint = Text.objects.get(text_code="imprint", language=lang)
context = {"rules": rules}
except Text.DoesNotExist:
imprint = None
context = {"rules": rules, "terms_of_service": terms_of_service, "imprint": imprint}
return render(
request,
"fellchensammlung/about.html",