mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2025-12-30 01:58:34 -05:00
- Changed the user prop to null in LocationCard component on the dashboard page. - Added isRestoring state to manage loading state during data restoration in settings. - Updated the restore button to show a loading spinner when a restore operation is in progress.
11 lines
405 B
Python
11 lines
405 B
Python
from rest_framework import serializers
|
|
|
|
def get_user_uuid(user):
|
|
return str(user.uuid)
|
|
|
|
class CustomModelSerializer(serializers.ModelSerializer):
|
|
def to_representation(self, instance):
|
|
representation = super().to_representation(instance)
|
|
if hasattr(instance, 'user') and instance.user:
|
|
representation['user'] = get_user_uuid(instance.user)
|
|
return representation |