summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/photos/models.py5
-rw-r--r--app/utils/widgets.py3
2 files changed, 6 insertions, 2 deletions
diff --git a/app/photos/models.py b/app/photos/models.py
index ac85a50..4249e6f 100644
--- a/app/photos/models.py
+++ b/app/photos/models.py
@@ -113,6 +113,11 @@ class LuxImage(models.Model):
if size == "original":
return "%soriginal/%s/%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, self.get_image_ext())
else:
+ if size != 'tn':
+ s = LuxImageSize.objects.get(name=size)
+ if s not in self.sizes.all():
+ print("new size is "+s.name)
+ self.sizes.add(s)
return "%s%s/%s_%s.%s" % (settings.IMAGES_URL, self.pub_date.strftime("%Y"), base, size, self.get_image_ext())
def get_image_path_by_size(self, size="original"):
diff --git a/app/utils/widgets.py b/app/utils/widgets.py
index 4f96e38..3c97b12 100644
--- a/app/utils/widgets.py
+++ b/app/utils/widgets.py
@@ -158,8 +158,7 @@ def parse_image(s):
print('caption'+str(caption))
else:
css_class = cl[0]
- c = Context({'image': i, 'caption': caption, 'exif': exif, 'cluster_class': cluster_class, 'extra':extra})
- return render_to_string("lib/img_%s.html" % css_class, c)
+ return render_to_string("lib/img_%s.html" % css_class, {'image': i, 'caption': caption, 'exif': exif, 'cluster_class': cluster_class, 'extra':extra})
def parse_video(s):