Revised the import of django.utils.timezone.localdate.

This commit is contained in:
imacat committed 2020-07-16 22:22:35 +08:00
1 parent 27f762a1c0
commit 5b9ac93ee5
3 files changed
+23 -23

No files matched your search

+2 -3
View File
@@ -25,8 +25,7 @@ from django.db import connection
from django.http import HttpResponseRedirect, Http404
from django.shortcuts import render
from django.urls import reverse
from django.utils import dateformat
from django.utils.timezone import localdate
from django.utils import dateformat, timezone
from django.utils.translation import pgettext
from django.views.decorators.http import require_GET
@@ -61,7 +60,7 @@ def cash_home(request):
and month.
"""
subject_code = settings.ACCOUNTING["DEFAULT_CASH_SUBJECT"]
period_spec = dateformat.format(localdate(), "Y-m")
period_spec = dateformat.format(timezone.localdate(), "Y-m")
return HttpResponseRedirect(
reverse("accounting:cash", args=(subject_code, period_spec)))