-
Notifications
You must be signed in to change notification settings - Fork 12
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
fix(cleanup): convert cleanup migration to command #467
Conversation
2f87637
to
3726786
Compare
if ( | ||
path not in used_files | ||
and os.path.isfile(path) | ||
and path.endswith(".docx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this endswith
restriction is actually needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
if not options.get("dry"): | ||
os.remove(path) | ||
self.stdout.write( | ||
self.style.SUCCESS(f"Deleted dangling file '{path}'") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: change the message depending on dry
mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid point! Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The cleanup migration is too dangerous since it will possibly delete production data if something goes wrong. This commit converts the migration to a command which can be called manually and has a dry run option to test it beforehand.
3726786
to
7373a1e
Compare
The cleanup migration is too dangerous since it will possibly delete production data if something goes wrong. This commit converts the migration to a command which can be called manually and has a dry run option to test it beforehand.