Skip to content
Snippets Groups Projects

voucher validity

Merged Piotr Gawron requested to merge 212-voucher-validity into master
1 unresolved thread

Vouchers expiry after 90 days. 7 days before expiry date there is a notification about it.

Closes #212 (closed)

Edited by Piotr Gawron

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
61 if instance.status == VOUCHER_STATUS_USED or instance.status == VOUCHER_STATUS_EXPIRED:
63 62 self.fields['status'].widget.attrs['readonly'] = True
64 63 self.fields['feedback'].widget.attrs['readonly'] = True
65 self.fields['usage_partner'].widget.attrs['readonly'] = True
66
67 def clean(self):
68 if self.cleaned_data["status"] == VOUCHER_STATUS_USED and not self.cleaned_data["usage_partner"]:
69 self.add_error('usage_partner', "Partner must be defined for used voucher")
70 if self.cleaned_data["status"] != VOUCHER_STATUS_USED and self.cleaned_data["usage_partner"]:
71 self.add_error('status', "Status must be used for voucher with defined partner")
72 64
73 65 def save(self, commit=True):
74 66 instance = super(VoucherForm, self).save(commit=False)
75 67 if not instance.id:
76 68 instance.issue_date = timezone.now()
77 instance.expiry_date = instance.issue_date + datetime.timedelta(days=92)
  • Screen_Shot_2018-06-06_at_16.06.39

    works fine from what I've seen. I had to modify the notifications study setting directly in the db but it worked.

  • Valentin Groues mentioned in commit 1fd78ba7

    mentioned in commit 1fd78ba7

  • Please register or sign in to reply
    Loading