Add checks for other fields

This commit is contained in:
zandercymatics 2024-02-26 10:49:38 -07:00
parent 4d4cd8257c
commit d416ea5138
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
2 changed files with 36 additions and 35 deletions

View file

@ -77,15 +77,15 @@ class FSMErrorCodes(IntEnum):
"""Used when doing FSM transitions.
Overview of generic error codes:
- 1 APPROVE_DOMAIN_IN_USE The domain is already in use
- 2 APPROVE_NO_INVESTIGATOR No investigator is assigned when approving
- 3 APPROVE_INVESTIGATOR_NOT_STAFF Investigator is a non-staff user
- 4 APPROVE_INVESTIGATOR_NOT_SUBMITTER The form submitter is not the investigator
- 2 NO_INVESTIGATOR No investigator is assigned
- 3 INVESTIGATOR_NOT_STAFF Investigator is a non-staff user
- 4 INVESTIGATOR_NOT_SUBMITTER The form submitter is not the investigator
"""
APPROVE_DOMAIN_IN_USE = 1
APPROVE_NO_INVESTIGATOR = 2
APPROVE_INVESTIGATOR_NOT_STAFF = 3
APPROVE_INVESTIGATOR_NOT_SUBMITTER = 4
NO_INVESTIGATOR = 2
INVESTIGATOR_NOT_STAFF = 3
INVESTIGATOR_NOT_SUBMITTER = 4
# (Q for reviewers) What should this be called?
@ -98,10 +98,10 @@ class ApplicationStatusError(Exception):
_error_mapping = {
FSMErrorCodes.APPROVE_DOMAIN_IN_USE: ("Cannot approve. Requested domain is already in use."),
FSMErrorCodes.APPROVE_NO_INVESTIGATOR: ("Cannot approve. No investigator was assigned."),
FSMErrorCodes.APPROVE_INVESTIGATOR_NOT_STAFF: ("Cannot approve. Investigator is not a staff user."),
FSMErrorCodes.APPROVE_INVESTIGATOR_NOT_SUBMITTER: (
"Cannot approve. Only the assigned investigator can approve this application."
FSMErrorCodes.NO_INVESTIGATOR: ("No investigator was assigned."),
FSMErrorCodes.INVESTIGATOR_NOT_STAFF: ("Investigator is not a staff user."),
FSMErrorCodes.INVESTIGATOR_NOT_SUBMITTER: (
"Only the assigned investigator can make this change."
),
}