From 6153850da86c3158ad86b3a3bf1593c396e46b03 Mon Sep 17 00:00:00 2001 From: luxagraf Date: Wed, 2 Dec 2020 16:13:45 -0500 Subject: fixed a bug with admin inserts. i think --- app/media/models.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/media') diff --git a/app/media/models.py b/app/media/models.py index 2fc669a..b67699b 100644 --- a/app/media/models.py +++ b/app/media/models.py @@ -146,6 +146,8 @@ class LuxImage(models.Model): def get_image_url_by_size(self, size="original"): if size == "original": return self.image.url + if size == "admin_insert": + return "images/%s/%s.%s" % (self.pub_date.strftime("%Y"), self.image_name, self.image_ext) else: luximagesize = LuxImageSize.objects.get(slug=size) #if luximagesize not in self.get_sizes: @@ -304,6 +306,9 @@ class LuxAudio(models.Model): def get_absolute_url(self): return reverse("prompt:detail", kwargs={"slug": self.slug}) + def get_image_url_by_size(self, size="original"): + pass + @property def get_previous_published(self): return self.get_previous_by_pub_date(status__exact=1) -- cgit v1.2.3-70-g09d2