#38 User requests
* implements 2) "Multiple revocations for interventions"
This commit is contained in:
@@ -147,7 +147,7 @@ def get_revocation_view(request: HttpRequest, doc_id: str):
|
||||
"""
|
||||
doc = get_object_or_404(RevocationDocument, id=doc_id)
|
||||
# File download only possible if related instance is shared with user
|
||||
if not doc.instance.users.filter(id=request.user.id):
|
||||
if not doc.instance.legal.intervention.users.filter(id=request.user.id):
|
||||
messages.info(
|
||||
request,
|
||||
DATA_UNSHARED
|
||||
@@ -238,10 +238,10 @@ def detail_view(request: HttpRequest, id: str):
|
||||
)
|
||||
|
||||
# Inform user about revocation
|
||||
if intervention.legal.revocation:
|
||||
if intervention.legal.revocations.exists():
|
||||
messages.error(
|
||||
request,
|
||||
_("This intervention has a revocation from {}").format(intervention.legal.revocation.date.strftime(DEFAULT_DATE_FORMAT)),
|
||||
_("This intervention has {} revocations").format(intervention.legal.revocations.count()),
|
||||
extra_tags="danger",
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user