Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fixed unpaid paper reminders queryset to be evaluated every time. #71

Merged
merged 2 commits into from

1 participant

Antti Jaakkola
Antti Jaakkola
Owner

Unpaid paper reminder queryset is evaluated once at startup and used forever.

Added simple wrapper view to ensure queryset is evaluated on every request.

Antti Jaakkola annttu merged commit 1638a7c into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 23 additions and 10 deletions.
  1. +2 −9 membership/urls.py
  2. +20 −0 membership/views.py
  3. +1 −1  sikteeri/version.py
11 membership/urls.py
View
@@ -103,15 +103,8 @@
'template_object_name': 'member',
'mimetype': 'text/plain'},
name='approved_memberships_emails'),
- url(r'memberships/unpaid_paper_reminded/$', 'membership.views.member_object_list',
- {'queryset': Membership.paper_reminder_sent_unpaid_after(),
- 'template_name': 'membership/membership_list.html',
- 'template_object_name': 'member',
- 'paginate_by': ENTRIES_PER_PAGE}, name='unpaid_paper_reminded_memberships'),
- url(r'memberships/unpaid_paper_reminded-plain/$', 'membership.views.member_object_list',
- {'queryset': Membership.paper_reminder_sent_unpaid_after().order_by('id'),
- 'template_name': 'membership/membership_list_plaintext.html',
- 'template_object_name': 'member'},
+ url(r'memberships/unpaid_paper_reminded/$', 'membership.views.unpaid_paper_reminded', name='unpaid_paper_reminded_memberships'),
+ url(r'memberships/unpaid_paper_reminded-plain/$', 'membership.views.unpaid_paper_reminded_plain',
name='unpaid_paper_reminded_memberships_plain'),
url(r'memberships/deleted/$', 'membership.views.member_object_list',
{'queryset': Membership.objects.filter(status__exact='D').order_by('-id'),
20 membership/views.py
View
@@ -811,6 +811,26 @@ def membership_duplicates(request, id):
return member_object_list(request, **view_params)
+@permission_required('membership.read_members')
+def unpaid_paper_reminded(request):
+ view_params = {'queryset': Membership.paper_reminder_sent_unpaid_after(),
+ 'template_name': 'membership/membership_list.html',
+ 'template_object_name': 'member',
+ 'paginate_by': ENTRIES_PER_PAGE
+ }
+
+ return member_object_list(request, **view_params)
+
+@permission_required('membership.read_members')
+def unpaid_paper_reminded_plain(request):
+ view_params = {'queryset': Membership.paper_reminder_sent_unpaid_after().order_by('id'),
+ 'template_name': 'membership/membership_list_plaintext.html',
+ 'template_object_name': 'member'
+ }
+
+ return member_object_list(request, **view_params)
+
+
@permission_required('membership.delete_members')
@transaction.commit_on_success
def membership_delete(request, id, template_name='membership/membership_delete.html'):
2  sikteeri/version.py
View
@@ -1,4 +1,4 @@
#!/usr/bin/env python
# encoding: utf-8
-VERSION = '''1.2.5'''
+VERSION = '''1.2.6'''
Something went wrong with that request. Please try again.