From 1498fba7b3446e52bacc540c9ac6237d9bbd3c96 Mon Sep 17 00:00:00 2001 From: Debian Date: Sun, 4 Aug 2024 17:23:44 +0000 Subject: [PATCH] hotfix --- awa/models.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/awa/models.py b/awa/models.py index b624d52..d5ed465 100644 --- a/awa/models.py +++ b/awa/models.py @@ -6,23 +6,23 @@ IMAGE_ROOT = 'images' -def image_directory(model, filename, role=None): - return f'{list(filter(lambda x: x is not None, [ +def image_upload_path(model, filename, role=None): + return list(filter(lambda x: x is not None, [ IMAGE_ROOT, model._meta.app_name, Context.objects.slugify(model._meta.verbose_name), role, Context.objects.slugify(str(model)), filename - ])).join('/')}' + ])).join('/') -icon_directory = partial(image_directory, role='icons') +icon_upload_path = partial(image_directory, role='icons') class IconMixin(models.Model): icon = models.ImageField( - upload_to=icon_directory, + upload_to=icon_upload_path, height_field="icon_height", width_field="icon_width", blank=True,