Fix #192 -- Disable bank import after last date of payments

This commit is contained in:
Raphael Michel
2017-01-14 16:12:25 +01:00
parent f285390f46
commit 7120e95d2a
2 changed files with 40 additions and 27 deletions

View File

@@ -354,4 +354,8 @@ class ImportView(EventPermissionRequiredMixin, ListView):
def get_context_data(self, **kwargs):
ctx = super().get_context_data()
ctx['job_running'] = self.job_running
ctx['no_more_payments'] = False
if self.request.event.settings.get('payment_term_last'):
if now() > self.request.event.payment_term_last:
ctx['no_more_payments'] = True
return ctx