Files
AdventureLog/backend/server/main/utils.py
Sean Morley 682dc1abe8 fix: update LocationCard props and enhance restore data functionality
- 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.
2025-12-16 11:19:05 -05:00

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