Skip to content

Commit

Permalink
Add poster field
Browse files Browse the repository at this point in the history
  • Loading branch information
KwikKill committed Nov 21, 2024
1 parent ed00920 commit 25f161b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions insalan/tournament/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ class Event(models.Model):
FileExtensionValidator(allowed_extensions=["png", "jpg", "jpeg", "svg", "webp", "avif"])
],
)
poster: models.FileField = ImageField(
verbose_name=_("Affiche"),
blank=True,
null=True,
upload_to="event-posters",
validators=[
FileExtensionValidator(allowed_extensions=["png", "jpg", "jpeg", "svg", "webp", "avif"])
],
)

class Meta:
"""Meta options"""
Expand Down
1 change: 1 addition & 0 deletions insalan/tournament/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ class Meta:
"ongoing",
"tournaments",
"logo",
"poster",
]


Expand Down
3 changes: 3 additions & 0 deletions insalan/tournament/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1185,6 +1185,7 @@ def test_example(self):
"month": 12,
"ongoing": False,
"logo": None,
"poster": None,
"seats": [
(
seat_one.x,
Expand Down Expand Up @@ -1467,6 +1468,7 @@ def test_deref_not_announced(self):
}
],
"logo": None,
"poster": None,
}
self.assertEqual(request.data, model)

Expand Down Expand Up @@ -1531,6 +1533,7 @@ def test_deref(self):
}
],
"logo": None,
"poster": None,
}
self.assertEqual(request.data, model)

Expand Down

0 comments on commit 25f161b

Please sign in to comment.