summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archaeological_finds/forms.py4
-rw-r--r--archaeological_finds/forms_treatments.py8
2 files changed, 6 insertions, 6 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index 95138c158..3c84f71ee 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -2517,8 +2517,8 @@ class FindBasketForm(IshtarForm):
self.basket_pk = kwargs.pop("basket_pk")
self.is_admin = None
if "user" in kwargs:
- user = kwargs.pop("user")
- self.is_admin = getattr(user, "is_superuser", None)
+ self.user = kwargs.pop("user")
+ self.is_admin = getattr(self.user, "is_superuser", None)
super(FindBasketForm, self).__init__(*args, **kwargs)
if not self.is_admin:
self.fields.pop("slug")
diff --git a/archaeological_finds/forms_treatments.py b/archaeological_finds/forms_treatments.py
index 3b71b388d..ad12e7a18 100644
--- a/archaeological_finds/forms_treatments.py
+++ b/archaeological_finds/forms_treatments.py
@@ -259,7 +259,7 @@ class BaseTreatmentForm(CustomForm, ManageOldType):
]
def __init__(self, *args, **kwargs):
- user = kwargs.pop('user')
+ self.user = kwargs.pop('user')
current_profile = get_current_profile()
has_default_location = kwargs.get("data", None) or (
"initial" in kwargs and
@@ -287,7 +287,7 @@ class BaseTreatmentForm(CustomForm, ManageOldType):
models.TreatmentInputStatus.get_types(
empty_first=False, dct={'executed': True})
- q = Person.objects.filter(ishtaruser__pk=user.pk)
+ q = Person.objects.filter(ishtaruser__pk=self.user.pk)
if q.count():
person = q.all()[0]
self.fields['scientific_monitoring_manager'].initial = person.pk
@@ -825,9 +825,9 @@ class TreatmentFileForm(CustomForm, ManageOldType):
)
def __init__(self, *args, **kwargs):
- user = kwargs.pop('user')
+ self.user = kwargs.pop('user')
super(TreatmentFileForm, self).__init__(*args, **kwargs)
- q = Person.objects.filter(ishtaruser__pk=user.pk)
+ q = Person.objects.filter(ishtaruser__pk=self.user.pk)
if q.count():
person = q.all()[0]
self.fields['in_charge'].initial = person.pk