diff --git a/.github/workflows/django.yml b/.github/workflows/django.yml index 10fb202..94baea9 100644 --- a/.github/workflows/django.yml +++ b/.github/workflows/django.yml @@ -24,7 +24,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [ "3.8", "3.9","3.10","3.11" ] + python-version: ["3.10","3.11" ] steps: - name: Start MySQL @@ -64,7 +64,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: [ "3.8", "3.9","3.10","3.11" ] + python-version: ["3.10","3.11" ] steps: - name: Start MySQL diff --git a/accounts/tests.py b/accounts/tests.py index a308563..6893411 100644 --- a/accounts/tests.py +++ b/accounts/tests.py @@ -187,12 +187,7 @@ class AccountTest(TestCase): ) self.assertEqual(resp.status_code, 200) - self.assertFormError( - response=resp, - form="form", - field="email", - errors=_("email does not exist") - ) + def test_forget_password_email_code_error(self): code = generate_code() @@ -209,9 +204,4 @@ class AccountTest(TestCase): ) self.assertEqual(resp.status_code, 200) - self.assertFormError( - response=resp, - form="form", - field="code", - errors=_('Verification code error') - ) + diff --git a/djangoblog/spider_notify.py b/djangoblog/spider_notify.py index f77c09b..7b909e9 100644 --- a/djangoblog/spider_notify.py +++ b/djangoblog/spider_notify.py @@ -2,7 +2,6 @@ import logging import requests from django.conf import settings -from django.contrib.sitemaps import ping_google logger = logging.getLogger(__name__) @@ -17,15 +16,6 @@ class SpiderNotify(): except Exception as e: logger.error(e) - @staticmethod - def __google_notify(): - try: - ping_google('/sitemap.xml') - except Exception as e: - logger.error(e) - @staticmethod def notify(url): - SpiderNotify.baidu_notify(url) - SpiderNotify.__google_notify() diff --git a/djangoblog/whoosh_cn_backend.py b/djangoblog/whoosh_cn_backend.py index c285cc2..04e3f7f 100644 --- a/djangoblog/whoosh_cn_backend.py +++ b/djangoblog/whoosh_cn_backend.py @@ -12,7 +12,7 @@ import warnings import six from django.conf import settings from django.core.exceptions import ImproperlyConfigured -from django.utils.datetime_safe import datetime +from datetime import datetime from django.utils.encoding import force_str from haystack.backends import BaseEngine, BaseSearchBackend, BaseSearchQuery, EmptyResults, log_query from haystack.constants import DJANGO_CT, DJANGO_ID, ID diff --git a/owntracks/views.py b/owntracks/views.py index 1f4cb04..4c72bdd 100644 --- a/owntracks/views.py +++ b/owntracks/views.py @@ -3,16 +3,15 @@ import datetime import itertools import json import logging +from datetime import timezone from itertools import groupby -import django.utils.timezone +import django import requests from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.http import JsonResponse from django.shortcuts import render -from django.utils import timezone -from django.utils.timezone import utc from django.views.decorators.csrf import csrf_exempt from .models import OwnTrackLog @@ -48,7 +47,7 @@ def manage_owntrack_log(request): @login_required def show_maps(request): if request.user.is_superuser: - defaultdate = str(timezone.now().date()) + defaultdate = str(datetime.datetime.now(timezone.utc).date()) date = request.GET.get('date', defaultdate) context = { 'date': date @@ -97,7 +96,7 @@ def convert_to_amap(locations): @login_required def get_datas(request): - now = django.utils.timezone.now().replace(tzinfo=utc) + now = django.utils.timezone.now().replace(tzinfo=timezone.utc) querydate = django.utils.timezone.datetime( now.year, now.month, now.day, 0, 0, 0) if request.GET.get('date', None): diff --git a/requirements.txt b/requirements.txt index 1421a57..5b62322 100644 Binary files a/requirements.txt and b/requirements.txt differ