You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When someone re-imports a NOFO document, all of the previous sections and subsections are deleted and replaced with completely new sections and subsections.
This has the potential to cause problems — and one time it did, leading us to restore from a database backup to get the old version of the NOFO again.
We don't allow (non-admin) users to completely delete a NOFO, which is why we introduced the concept of "archiving" a NOFO. By the same token, we shouldn't allow people to wipe out all of a NOFO's content, which is akin to what deleting a NOFO actually means.
Functional requirements
We want this all to be invisible from a user's perspective, which means that we should not archive the current NOFO they are using and give them a new URL. People link to NOFOs by id number, so we should keep their existing URLs working. Instead, let's clone their NOFO, archive it, and then overwrite sections & subsections as we do now.
Before we overwrite_nofo, duplicate our original NOFO
The duplicated NOFO should immediately be set to "archived"
Then we call overwrite_nofo
Also, we should introduce a new NOFO model field called ancestor or something (int field, default null), which would contain the ID of the archived NOFO. The idea here is that a NOFO should know how to find its previous version. If there are multiple previous versions, we can just pull them sequentially.
This puts us in a way better spot so that we can prevent users from messing things up unintentionally or intentionally.
The text was updated successfully, but these errors were encountered:
pcraig3
added
the
Dev
This is a dev priority ticket, not strictly user-facing
label
Jan 16, 2025
Summary
When someone re-imports a NOFO document, all of the previous sections and subsections are deleted and replaced with completely new sections and subsections.
This has the potential to cause problems — and one time it did, leading us to restore from a database backup to get the old version of the NOFO again.
We don't allow (non-admin) users to completely delete a NOFO, which is why we introduced the concept of "archiving" a NOFO. By the same token, we shouldn't allow people to wipe out all of a NOFO's content, which is akin to what deleting a NOFO actually means.
Functional requirements
We want this all to be invisible from a user's perspective, which means that we should not archive the current NOFO they are using and give them a new URL. People link to NOFOs by id number, so we should keep their existing URLs working. Instead, let's clone their NOFO, archive it, and then overwrite sections & subsections as we do now.
As context: When re-import is successful, we create an internal dictionary of
sections
and then calloverwrite_nofo
. This wipes out all existing sections (and subsections).Instead, let's do something like this:
overwrite_nofo
, duplicate our original NOFOoverwrite_nofo
Also, we should introduce a new NOFO model field called
ancestor
or something (int
field, defaultnull
), which would contain the ID of the archived NOFO. The idea here is that a NOFO should know how to find its previous version. If there are multiple previous versions, we can just pull them sequentially.This puts us in a way better spot so that we can prevent users from messing things up unintentionally or intentionally.
The text was updated successfully, but these errors were encountered: