mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 17:31:34 -05:00
When a template is archived, it should no longer belong to any folder. If we don’t do this it will make it very hard to delete folders later (because folders can only be deleted if they have no templates or folders inside them). We originally tried to check if the link between a template and folder should be removed with `if template.archived and template.folder:` instead of using `if template.archived:`. However, this caused issues because checking `template.folder` flushes the session. Since the session is no longer dirty, the versioning decorator doesn't work as expected and doesn't create a new row in `TemplateHistory`.