Skip to content
Snippets Groups Projects
Commit b7dac530 authored by Carlos Vega's avatar Carlos Vega
Browse files

Fixes issue #222 in which the voucher partner and health partner shown the...

Fixes issue #222 in which the voucher partner and health partner shown the option to select role. This option is now hidden.
parent a36d9aae
No related branches found
No related tags found
1 merge request!168Fixes issue #222 in which the voucher partner and health partner shown the option to select a role
Pipeline #6567 passed
......@@ -9,7 +9,7 @@ from django_common.auth_backends import User
from web.models import Worker, WorkerStudyRole
from web.models.constants import GLOBAL_STUDY_ID
from web.models.worker import role_choices_by_worker_type, worker_type_by_worker
from web.models.worker_study_role import WORKER_STAFF, WORKER_VOUCHER_PARTNER
from web.models.worker_study_role import WORKER_STAFF, WORKER_VOUCHER_PARTNER, WORKER_HEALTH_PARTNER
logger = logging.getLogger(__name__)
......@@ -33,7 +33,11 @@ class WorkerForm(ModelForm):
initial_role = roles[0].role
choices = role_choices_by_worker_type(worker_type)
self.fields['role'] = forms.ChoiceField(label='Role', choices=choices)
if worker_type in [WORKER_VOUCHER_PARTNER, WORKER_HEALTH_PARTNER]:
self.fields['role'] = forms.ChoiceField(label='Role', choices=choices, widget=forms.HiddenInput(), required=False)
else:
self.fields['role'] = forms.ChoiceField(label='Role', choices=choices)
self.fields['role'].initial = initial_role
del self.fields['user']
......
......@@ -27,7 +27,7 @@
<div class="box-body">
<div class="col-sm-6">
{% for field in form %}
{% for field in form.visible_fields %}
<div class="form-group {% if field.errors %}has-error{% endif %}">
<label for="{# TODO #}" class="col-sm-4 control-label">
{{ field.label }}
......
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