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