From 2c1d1dc9216ca5deb8d5ad29cdd7d5ab94f5ce47 Mon Sep 17 00:00:00 2001 From: Piotr Gawron <piotr.gawron@uni.lu> Date: Tue, 5 Jun 2018 10:13:49 +0200 Subject: [PATCH] multiple === operators changed into "in" operator --- smash/web/forms/voucher_forms.py | 4 ++-- smash/web/templates/vouchers/add_edit.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/smash/web/forms/voucher_forms.py b/smash/web/forms/voucher_forms.py index efb1c590..7768920a 100644 --- a/smash/web/forms/voucher_forms.py +++ b/smash/web/forms/voucher_forms.py @@ -8,7 +8,7 @@ from django.utils import timezone from web.algorithm import VerhoeffAlgorithm from web.forms.forms import DATEPICKER_DATE_ATTRS from web.models import VoucherType, VoucherTypePrice, Voucher, Worker -from web.models.constants import VOUCHER_STATUS_NEW, VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED +from web.models.constants import VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED from web.models.worker_study_role import WORKER_VOUCHER_PARTNER logger = logging.getLogger(__name__) @@ -58,7 +58,7 @@ class VoucherForm(ModelForm): self.fields['hours'].widget.attrs['readonly'] = True self.fields['usage_partner'].widget.attrs['readonly'] = True - if instance.status == VOUCHER_STATUS_USED or instance.status == VOUCHER_STATUS_EXPIRED: + if instance.status in [VOUCHER_STATUS_USED, VOUCHER_STATUS_EXPIRED]: self.fields['status'].widget.attrs['readonly'] = True self.fields['feedback'].widget.attrs['readonly'] = True diff --git a/smash/web/templates/vouchers/add_edit.html b/smash/web/templates/vouchers/add_edit.html index c3aa458e..c0083e92 100644 --- a/smash/web/templates/vouchers/add_edit.html +++ b/smash/web/templates/vouchers/add_edit.html @@ -61,7 +61,7 @@ </form> {% if voucher.id %} <h3 class="box-title">List of voucher partner sessions - {% if voucher.status == 'NEW' or voucher.status == 'IN_USE' %} + {% if voucher.status in 'NEW,IN_USE' %} <a title="add a new voucher partner session" id="add-voucher-partner-session" -- GitLab