Skip to content

Commit

Permalink
Custom file field with relative url
Browse files Browse the repository at this point in the history
  • Loading branch information
mmihalik committed Dec 14, 2024
1 parent 729501a commit d9cc30c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions competition/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ class Meta:
model = models.Publication
fields = '__all__'

def __init__(self, instance=None, data=..., **kwargs):
super().__init__(instance, data, **kwargs)

self.fields['file'].context.pop('request', None)

def get_verbose_name(self, obj):
return str(obj)

Expand Down

0 comments on commit d9cc30c

Please sign in to comment.