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)