mpeltriaux
b51f743be2
* splits ema/views.py (+700 lines) into separate files in new module * view files can now be found in /ema/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.urls import reverse
|
|
from django.utils.translation import gettext_lazy as _
|
|
|
|
from ema.models import Ema
|
|
from konova.decorators import shared_access_required, conservation_office_group_required
|
|
from konova.forms.modals import ResubmissionModalForm
|
|
|
|
|
|
@login_required
|
|
@conservation_office_group_required
|
|
@shared_access_required(Ema, "id")
|
|
def create_resubmission_view(request: HttpRequest, id: str):
|
|
""" Renders resubmission form for an EMA
|
|
|
|
Args:
|
|
request (HttpRequest): The incoming request
|
|
id (str): EMA's id
|
|
|
|
Returns:
|
|
|
|
"""
|
|
ema = get_object_or_404(Ema, id=id)
|
|
form = ResubmissionModalForm(request.POST or None, instance=ema, request=request)
|
|
form.action_url = reverse("ema:resubmission-create", args=(id,))
|
|
return form.process_request(
|
|
request,
|
|
msg_success=_("Resubmission set"),
|
|
redirect_url=reverse("ema:detail", args=(id,))
|
|
)
|