From d641d7b44db62473f380646092de5988d7e7ec69 Mon Sep 17 00:00:00 2001 From: reverend Date: Sun, 4 Apr 2021 16:55:56 +0200 Subject: [PATCH] Backwards compatibality --- django_lostplaces/lostplaces/models/place.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/django_lostplaces/lostplaces/models/place.py b/django_lostplaces/lostplaces/models/place.py index a0d1b99..6114abd 100644 --- a/django_lostplaces/lostplaces/models/place.py +++ b/django_lostplaces/lostplaces/models/place.py @@ -48,7 +48,6 @@ class Place(Submittable, Taggable, Mapable): def __str__(self): return self.name - def generate_place_image_filename(instance, filename): """ Callback for generating filename for uploaded place images. @@ -57,6 +56,9 @@ def generate_place_image_filename(instance, filename): return 'places/' + str(instance.place.pk) + '-' + str(instance.place.name) + '.' + filename.split('.')[-1] +def generate_image_upload_path(instance, filename): + return generate_place_image_filename(instance, filename) + class PlaceAsset(Submittable): """ Assets to a place, i.e. images