Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Management command filer_check does not find orphaned files in the private storage #1514

Closed
MarcoSteinacher opened this issue Jan 27, 2025 · 2 comments

Comments

@MarcoSteinacher
Copy link

The command ./manage.py filer_check --orphans (and --delete-orphans) does not scan for orphaned files in the private storage («Secure Downloads» / smedia). Only the media directory is scanned.

I fixed the problem for my use case here, but since I'm not familiar with all the internals of django-filer, I'm not sure if that is done in a proper way.

Baraff24 added a commit to Baraff24/django-filer that referenced this issue Mar 10, 2025
Issues: Management command filer_check does not find orphaned files in the private storage django-cms#1514
@Baraff24
Copy link
Contributor

The command ./manage.py filer_check --orphans (and --delete-orphans) does not scan for orphaned files in the private storage («Secure Downloads» / smedia). Only the media directory is scanned.

I fixed the problem for my use case here, but since I'm not familiar with all the internals of django-filer, I'm not sure if that is done in a proper way.

Maybe I've found a fix for this issue. The PR is the #1518

fsbraun added a commit that referenced this issue Mar 20, 2025
…Command (#1518)

* feat: add filename length safety check with random suffix

* fix: correct base filename length for validation test

* fix: update base filename length in validation test

* test: enhance filename length validation and edge case handling
Integration of the suggestion from the community and sourcery-ai

* fix: update _ensure_safe_length to use settings for max length and random suffix

* test: read max filename length and random suffix from settings

* fix: set default values for max filename length and random suffix in _ensure_safe_length

* Update filer/utils/files.py

* Apply suggestions from code review

* refactor: improve command help text and streamline orphan file handling
Issues: Management command filer_check does not find orphaned files in the private storage #1514

* refactor: enhance output messages and improve storage handling in filer_check

* fix: add missing newline at end of test_filer_check.py

* Update test.yml

---------

Co-authored-by: Fabian Braun <[email protected]>
@fsbraun fsbraun closed this as completed Mar 21, 2025
@MarcoSteinacher
Copy link
Author

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants