diff --git a/fir_ser/api/migrations/0012_auto_20210127_2101.py b/fir_ser/api/migrations/0012_auto_20210127_2101.py new file mode 100644 index 0000000..4caa2ff --- /dev/null +++ b/fir_ser/api/migrations/0012_auto_20210127_2101.py @@ -0,0 +1,18 @@ +# Generated by Django 3.0.3 on 2021-01-27 21:01 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0011_auto_20210125_1137'), + ] + + operations = [ + migrations.AlterField( + model_name='udidsyncdeveloper', + name='platform', + field=models.SmallIntegerField(choices=[(0, 'fly分发'), (1, 'app developer')], default=0, verbose_name='udid所在平台'), + ), + ] diff --git a/fir_ser/api/utils/serializer.py b/fir_ser/api/utils/serializer.py index 196335d..64486ca 100644 --- a/fir_ser/api/utils/serializer.py +++ b/fir_ser/api/utils/serializer.py @@ -11,11 +11,6 @@ logger = logging.getLogger(__file__) token_obj = DownloadToken() -def get_head_img(obj): - storage = Storage(obj) - return storage.get_download_url(obj.head_img) - - class UserInfoSerializer(serializers.ModelSerializer): class Meta: model = models.UserInfo @@ -26,6 +21,10 @@ class UserInfoSerializer(serializers.ModelSerializer): head_img = serializers.SerializerMethodField() + def get_head_img(self, obj): + storage = Storage(obj) + return storage.get_download_url(obj.head_img) + class AppsSerializer(serializers.ModelSerializer): class Meta: