mirror of
https://github.com/barkeser2002/offline-db.git
synced 2026-09-25 02:19:59 +03:00
- Added `bio` field to User model and migrations - Created `UserProfileUpdateSerializer` with RegexValidator (XSS) and Bleach (HTML sanitization) - Updated `ExternalSourceSerializer` to require `https://` or `magnet:` schemes - Replaced insecure extension checking with true MIME validation via `python-magic` in serializers (Subtitles, Images, Banners) - Fixed NextUI floating label overlap bug on magnet link input with `labelPlacement="outside"` and a placeholder. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Senpai-YoloBot <41898282+github-actions[bot]@users.noreply.github.com>
19 lines
632 B
Python
19 lines
632 B
Python
from rest_framework import serializers
|
|
from .models import Room
|
|
from content.serializers import EpisodeSerializer
|
|
|
|
import bleach
|
|
|
|
class RoomSerializer(serializers.ModelSerializer):
|
|
episode = EpisodeSerializer(read_only=True)
|
|
host_username = serializers.CharField(source='host.username', read_only=True)
|
|
|
|
class Meta:
|
|
model = Room
|
|
fields = ['uuid', 'episode', 'host_username', 'created_at', 'is_active', 'max_participants']
|
|
|
|
def validate_max_participants(self, value):
|
|
if value < 0:
|
|
raise serializers.ValidationError("max_participants cannot be negative.")
|
|
return value
|