summaryrefslogtreecommitdiff
path: root/archaeological_files
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_files')
-rw-r--r--archaeological_files/models.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/archaeological_files/models.py b/archaeological_files/models.py
index 529e3e0e6..d81433a25 100644
--- a/archaeological_files/models.py
+++ b/archaeological_files/models.py
@@ -29,7 +29,7 @@ from django.core.validators import MinValueValidator, MaxValueValidator
from django.db.models import Q, Count, Sum, Max
from django.db.models.signals import post_save, m2m_changed, post_delete
from django.urls import reverse
-from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy
+from ishtar_common.utils import ugettext_lazy as _, pgettext_lazy, get_current_profile
from ishtar_common.utils import (
cached_label_changed,
@@ -1241,7 +1241,8 @@ class File(
True,
),
]
- if self.can_do(request, "add_administrativeact"):
+ profile = get_current_profile()
+ if profile.preventive_operator:
actions += [
(
reverse("file-edit-preventive", args=[self.pk]),
@@ -1251,6 +1252,9 @@ class File(
"",
False,
),
+ ]
+ if self.can_do(request, "add_administrativeact"):
+ actions += [
(
reverse("file-add-adminact", args=[self.pk]),
_("Add associated administrative act"),