Skip to content

Commit

Permalink
Fix: Crash when moving files from a filtered directory listing
Browse files Browse the repository at this point in the history
Co-authored-by: @W1ldPo1nter
  • Loading branch information
fsbraun authored Jul 15, 2024
1 parent 3dc3a52 commit 4b0b5ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions filer/admin/folderadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,13 @@ def directory_listing(self, request, folder_id=None, viewtype=None):
order_by = request.GET.get('order_by', None)
order_by_annotation = None
if order_by is None:
file_qs = file_qs.annotate(coalesce_sort_field=Coalesce(
order_by_annotation = Lower(Coalesce(
Case(
When(name__exact='', then=None),
When(name__isnull=False, then='name')
),
'original_filename'
))
order_by_annotation = Lower('coalesce_sort_field')

order_by = order_by.split(',') if order_by else []
order_by = [field for field in order_by
Expand Down

0 comments on commit 4b0b5ec

Please sign in to comment.