Skip to content
Snippets Groups Projects
Commit b1aafb48 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

voucher partners and helat partners shouldn't have loactions and user defined

parent e4d97c48
No related branches found
No related tags found
1 merge request!119Resolve "User managment page"
...@@ -22,7 +22,7 @@ class WorkerForm(ModelForm): ...@@ -22,7 +22,7 @@ class WorkerForm(ModelForm):
instance = getattr(self, 'instance', None) instance = getattr(self, 'instance', None)
initial_role = None initial_role = None
if instance is not None: if instance is not None and instance.pk:
worker_type = worker_type_by_worker(instance) worker_type = worker_type_by_worker(instance)
roles = WorkerStudyRole.objects.filter(worker=instance, study_id=GLOBAL_STUDY_ID) roles = WorkerStudyRole.objects.filter(worker=instance, study_id=GLOBAL_STUDY_ID)
...@@ -35,6 +35,9 @@ class WorkerForm(ModelForm): ...@@ -35,6 +35,9 @@ class WorkerForm(ModelForm):
if worker_type == WORKER_STAFF: if worker_type == WORKER_STAFF:
del self.fields['voucher_types'] del self.fields['voucher_types']
else:
del self.fields['locations']
del self.fields['user']
def save(self, commit=True): def save(self, commit=True):
instance = super(WorkerForm, self).save(commit) instance = super(WorkerForm, self).save(commit)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment