requestcontext
authorgniibe <gniibe@fsij.org>
Thu, 19 Sep 2013 08:02:31 +0000 (17:02 +0900)
committergniibe <gniibe@fsij.org>
Thu, 19 Sep 2013 08:02:31 +0000 (17:02 +0900)
ChangeLog
accounting/views.py

index 6c6da6f..39c025c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2013-09-19  Niibe Yutaka  <gniibe@fsij.org>
+
+       * accounting/views.py (transaction_list): Use RequestContext.
+
+2013-08-29  Niibe Yutaka  <gniibe@fsij.org>
+
+       * auth_migrate.py: New.
+
 2013-07-01  Niibe Yutaka  <gniibe@fsij.org>
 
        * templates/top_page.html: Update for 2013.
index f7adfa5..20f8ce6 100644 (file)
@@ -3,6 +3,8 @@ from django.core.context_processors import csrf
 from django.shortcuts import render_to_response, get_object_or_404
 from django.contrib.auth.decorators import login_required, user_passes_test
 from django.http import HttpResponse, HttpResponseRedirect
+from django.template import RequestContext
+
 from fsij.accounting.models import Transaction, Account, Business, LedgerEntry, FinancialYear, GeneralLedgerEntry
 from fsij.membership.models import Member, MemberPayment
 from fsij.settings import LOGIN_URL
@@ -87,14 +89,13 @@ def transaction_list(request,year=None):
         tr_list = Transaction.objects.filter(date__range=(fy.begin(),fy.end())).order_by('date')
     else:
         tr_list = Transaction.objects.all().order_by('-date')
-    ctxt = {'year' : year,
+    ctxt = RequestContext(request, {'year' : year,
                                'tr_list': tr_list,
                                'b_list': Business.objects.all(),
                                'a_list': Account.objects.all(),
                                'members': Member.objects.all(),
                                'original_path': request.path,
-                               }
-    ctxt.update(csrf(request))
+                               })
     return render_to_response('accounting/transaction_list.html', ctxt)
 
 @user_passes_test(lambda u: u.has_perm('accounting.can_manage'), LOGIN_URL)