Permalink
Browse files

Fixed unpaid paper reminders queryset to be evaluated every time.

  • Loading branch information...
1 parent 43ea3d7 commit daeb149c95c2a2c650c555d8880ce24363d072d2 @annttu annttu committed Oct 15, 2013
Showing with 22 additions and 9 deletions.
  1. +2 −9 membership/urls.py
  2. +20 −0 membership/views.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'),
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'):

0 comments on commit daeb149

Please sign in to comment.