summaryrefslogtreecommitdiff
path: root/archaeological_finds/forms_treatments.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds/forms_treatments.py')
-rw-r--r--archaeological_finds/forms_treatments.py8
1 files changed, 4 insertions, 4 deletions
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