Skip to content
Snippets Groups Projects
Unverified Commit b657d788 authored by Dominik George's avatar Dominik George
Browse files

Implement get_public_url for some slide types

parent b4307f74
No related branches found
No related tags found
No related merge requests found
......@@ -44,3 +44,6 @@ class Slide(PolymorphicModel, PureDjangoModel):
@classmethod
def display_supported(cls, display):
return display.profile in cls._supported_profiles
def get_public_url(self, display=None):
raise NotImplementedError("Slide types need to implement the get_public_url method.")
......@@ -13,6 +13,9 @@ class ForeignURLSlide(Slide):
url = models.URLField(max_length=255, verbose_name=_("URL"))
def get_public_url(self, display=None):
return self.url
class UploadedFileSlide(Slide):
......@@ -43,6 +46,9 @@ class UploadedFileSlide(Slide):
validators=[FileExtensionValidator(allowed_extensions=TYPES)],
)
def get_public_url(self, display=None):
return self.file.url
class StaticContentSlide(Slide):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment