Skip to content

Commit 891545a

Browse files
committed
Use relative urls in publication file field
1 parent b41d2b6 commit 891545a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

competition/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ class Meta:
736736
event = models.ForeignKey(Event, null=True, on_delete=models.SET_NULL)
737737

738738
file = RestrictedFileField(
739-
upload_to='publications/%Y',
739+
upload_to='publications/%Y/',
740740
content_types=['application/pdf', 'application/zip'],
741741
verbose_name='súbor')
742742

competition/serializers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class Meta:
4242
model = models.Publication
4343
fields = '__all__'
4444

45+
def __init__(self, instance=None, data=..., **kwargs):
46+
super().__init__(instance, data, **kwargs)
47+
4548
def get_verbose_name(self, obj):
4649
return str(obj)
4750

0 commit comments

Comments
 (0)