Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Debian committed Aug 4, 2024
1 parent 426c956 commit 1498fba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions awa/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 1498fba

Please sign in to comment.