From 270e47999c9b799303ac9de9a1fd4a5fed2cb807 Mon Sep 17 00:00:00 2001 From: youngS Date: Fri, 9 Apr 2021 17:58:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/migrations/0036_auto_20210409_1512.py | 20 +++++++++++++++++++ fir_ser/api/utils/storage/caches.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 fir_ser/api/migrations/0036_auto_20210409_1512.py diff --git a/fir_ser/api/migrations/0036_auto_20210409_1512.py b/fir_ser/api/migrations/0036_auto_20210409_1512.py new file mode 100644 index 0000000..b4d720c --- /dev/null +++ b/fir_ser/api/migrations/0036_auto_20210409_1512.py @@ -0,0 +1,20 @@ +# Generated by Django 3.0.3 on 2021-04-09 15:12 + +from django.conf import settings +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0035_usercertificationinfo_reviewed_time'), + ] + + operations = [ + migrations.AlterField( + model_name='usercertificationinfo', + name='user_id', + field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='certification', to=settings.AUTH_USER_MODEL, verbose_name='用户ID'), + ), + ] diff --git a/fir_ser/api/utils/storage/caches.py b/fir_ser/api/utils/storage/caches.py index de3389b..919ebeb 100644 --- a/fir_ser/api/utils/storage/caches.py +++ b/fir_ser/api/utils/storage/caches.py @@ -377,7 +377,7 @@ def check_user_has_all_download_times(app_obj): user_id = app_obj.user_id_id user_cert_obj = UserCertificationInfo.objects.filter(user_id=user_id).first() auth_status = False - if user_cert_obj and user_cert_obj.status == 2: + if user_cert_obj and user_cert_obj.status == 1: auth_status = True return get_user_free_download_times(user_id, auth_status=auth_status) > 0 or check_user_can_download(user_id)