Skip to content

Commit

Permalink
Merge pull request #311 from ZdruzenieSTROM/update_problem_image
Browse files Browse the repository at this point in the history
Nahravanie obrazku k ulohu
  • Loading branch information
mmihalik authored Dec 9, 2023
2 parents 31761a3 + 91d5f29 commit 49337b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions competition/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,10 +368,14 @@ class Meta:
Series, verbose_name='úloha zaradená do série',
related_name='problems',
on_delete=models.CASCADE,)
image = RestrictedFileField(
content_types=['image/svg+xml', 'image/png'],

image = models.ImageField(
upload_to='problem_images/',
verbose_name='Obrázok k úlohe', null=True, blank=True)
verbose_name='Obrázok k úlohe',
null=True,
blank=True,
)

solution_pdf = RestrictedFileField(
content_types=['application/pdf'],
verbose_name='Vzorové riešenie', null=True, blank=True,
Expand Down
2 changes: 1 addition & 1 deletion competition/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class ProblemSerializer(serializers.ModelSerializer):
class Meta:
model = models.Problem
fields = '__all__'
read_only_fields = ['series']
read_only_fields = ['series', 'submitted', 'num_comments']

submitted = serializers.SerializerMethodField(
'submitted_solution')
Expand Down

0 comments on commit 49337b7

Please sign in to comment.