super_sign_new
nineven 4 years ago
parent ccc9a176f4
commit 65bae2d9c8
  1. 18
      fir_ser/api/migrations/0012_auto_20210127_2101.py
  2. 9
      fir_ser/api/utils/serializer.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所在平台'),
),
]

@ -11,11 +11,6 @@ logger = logging.getLogger(__file__)
token_obj = DownloadToken() token_obj = DownloadToken()
def get_head_img(obj):
storage = Storage(obj)
return storage.get_download_url(obj.head_img)
class UserInfoSerializer(serializers.ModelSerializer): class UserInfoSerializer(serializers.ModelSerializer):
class Meta: class Meta:
model = models.UserInfo model = models.UserInfo
@ -26,6 +21,10 @@ class UserInfoSerializer(serializers.ModelSerializer):
head_img = serializers.SerializerMethodField() 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 AppsSerializer(serializers.ModelSerializer):
class Meta: class Meta:

Loading…
Cancel
Save