mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-07-15 18:07:02 +00:00
csv/excel method changed, uploading to alibaba cloud and providing link to frontend
This commit is contained in:
@ -92,10 +92,7 @@ class UserCSVReportSerializer(serializers.ModelSerializer):
|
||||
:param obj: user object
|
||||
:return: user phone number
|
||||
"""
|
||||
if profile := obj.guardian_profile.all().first():
|
||||
return f"+{profile.country_code}{profile.phone}" \
|
||||
if profile.country_code and profile.phone else profile.phone
|
||||
elif profile := obj.junior_profile.all().first():
|
||||
if profile := (obj.guardian_profile.all().first() or obj.junior_profile.all().first()):
|
||||
return f"+{profile.country_code}{profile.phone}" \
|
||||
if profile.country_code and profile.phone else profile.phone
|
||||
else:
|
||||
@ -120,9 +117,7 @@ class UserCSVReportSerializer(serializers.ModelSerializer):
|
||||
:param obj: user object
|
||||
:return: user type
|
||||
"""
|
||||
if profile := obj.guardian_profile.all().first():
|
||||
return "Active" if profile.is_active else "Inactive"
|
||||
elif profile := obj.junior_profile.all().first():
|
||||
if profile := (obj.guardian_profile.all().first() or obj.junior_profile.all().first()):
|
||||
return "Active" if profile.is_active else "Inactive"
|
||||
|
||||
@staticmethod
|
||||
|
Reference in New Issue
Block a user