Refactoring

* moves updating of shared access users into ShareableObjectMixin
* renames ShareInterventionModalForm to ShareModalForm since it's used for EMA and eco accounts as well
This commit is contained in:
2021-11-16 12:54:28 +01:00
parent 6ad387daa3
commit 71e4aa9a2f
6 changed files with 27 additions and 27 deletions

View File

@@ -4,7 +4,7 @@ from django.http import HttpRequest, JsonResponse
from django.shortcuts import render
from intervention.forms.forms import NewInterventionForm, EditInterventionForm
from intervention.forms.modalForms import ShareInterventionModalForm, NewRevocationModalForm, \
from intervention.forms.modalForms import ShareModalForm, NewRevocationModalForm, \
CheckModalForm, NewDeductionModalForm, NewInterventionDocumentForm
from intervention.models import Intervention, Revocation, InterventionDocument, RevocationDocument
from intervention.tables import InterventionTable
@@ -402,7 +402,7 @@ def create_share_view(request: HttpRequest, id: str):
"""
intervention = get_object_or_404(Intervention, id=id)
form = ShareInterventionModalForm(request.POST or None, instance=intervention, request=request, user=request.user)
form = ShareModalForm(request.POST or None, instance=intervention, request=request, user=request.user)
return form.process_request(
request,
msg_success=_("Share settings updated")