# 382 - Redirect as 404

* extends 404 template (user should check the URL)
* introduces new decorator "uuid_required" which performs a check on a given 'uuid' or 'id' parameter
    * throws a Http404 exception --> redirect to 404 template instead of 500 error template
This commit is contained in:
2024-02-16 10:13:43 +01:00
parent 0b5691f501
commit 11cc8b6766
9 changed files with 62 additions and 30 deletions

View File

@@ -16,7 +16,8 @@ from intervention.forms.intervention import EditInterventionForm, NewInterventio
from intervention.models import Intervention
from intervention.tables import InterventionTable
from konova.contexts import BaseContext
from konova.decorators import default_group_required, shared_access_required, any_group_check, login_required_modal
from konova.decorators import default_group_required, shared_access_required, any_group_check, login_required_modal, \
uuid_required
from konova.forms import SimpleGeomForm
from konova.forms.modals import RemoveModalForm
from konova.settings import DEFAULT_GROUP, ZB_GROUP, ETS_GROUP
@@ -128,6 +129,7 @@ def new_id_view(request: HttpRequest):
@login_required
@any_group_check
@uuid_required
def detail_view(request: HttpRequest, id: str):
""" Renders a detail view for viewing an intervention's data