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

This commit is contained in:
2020-07-16 22:22:35 +08:00
parent 27f762a1c0
commit 5b9ac93ee5
3 changed files with 23 additions and 23 deletions

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)))