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

fix(cleanup): delete old files when template is deleted or changed #445

Merged
merged 1 commit into from
Nov 4, 2021

Conversation

anehx
Copy link
Member

@anehx anehx commented Nov 3, 2021

Resolves #437

Copy link
Member

@winged winged left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Just some minor notes

try:
old_file = Template.objects.get(pk=instance.pk).template
except Template.DoesNotExist:
return False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just return here, this isn't interpreted anywhere

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

except Template.DoesNotExist:
return False

if bool(old_file):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need for explicit bool cast

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@anehx anehx force-pushed the delete-file branch 2 times, most recently from 28f9794 to 6fa9a85 Compare November 4, 2021 15:36
@anehx anehx requested a review from winged November 4, 2021 15:37
@winged winged merged commit 26c9570 into main Nov 4, 2021
@anehx anehx deleted the delete-file branch August 9, 2022 11:19
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

Successfully merging this pull request may close these issues.

Templates files are not deleted
2 participants