mpeltriaux
ac0db79928
* splits intervention/views.py (+700 lines) into separate files in new module * view files can now be found in /intervention/views/...
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
"""
|
|
Author: Michel Peltriaux
|
|
Organization: Struktur- und Genehmigungsdirektion Nord, Rhineland-Palatinate, Germany
|
|
Contact: ksp-servicestelle@sgdnord.rlp.de
|
|
Created on: 19.08.22
|
|
|
|
"""
|
|
from django.contrib.auth.decorators import login_required
|
|
from django.http import HttpRequest
|
|
from django.shortcuts import get_object_or_404
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from intervention.forms.modals.check import CheckModalForm
|
|
from intervention.models import Intervention
|
|
from konova.decorators import registration_office_group_required, shared_access_required
|
|
from konova.utils.message_templates import INTERVENTION_INVALID
|
|
|
|
|
|
@login_required
|
|
@registration_office_group_required
|
|
@shared_access_required(Intervention, "id")
|
|
def check_view(request: HttpRequest, id: str):
|
|
""" Renders check form for an intervention
|
|
|
|
Args:
|
|
request (HttpRequest): The incoming request
|
|
id (str): Intervention's id
|
|
|
|
Returns:
|
|
|
|
"""
|
|
intervention = get_object_or_404(Intervention, id=id)
|
|
form = CheckModalForm(request.POST or None, instance=intervention, request=request)
|
|
return form.process_request(
|
|
request,
|
|
msg_success=_("Check performed"),
|
|
msg_error=INTERVENTION_INVALID
|
|
)
|
|
|