The application status is determined using the following logic:
- Application Data: Information from the application record
- Requires Approval Flag: Configuration from the popup city settings
- Reviews Status: The calculated status from reviews (if applicable)
-
Withdrawn or Rejected
- If reviews status is
WITHDRAWNorREJECTED, this status is used regardless of other factors.
- If reviews status is
-
Non-Approval Applications
- If the popup city does not require approval AND the applicant did not request a discount, the status is set to
ACCEPTED.
- If the popup city does not require approval AND the applicant did not request a discount, the status is set to
-
Draft or In-Review Applications
- If no reviews status exists OR a discount was requested but not assigned yet, the status will be:
IN_REVIEWif the application has been submittedDRAFTif the application has not been submitted
- If no reviews status exists OR a discount was requested but not assigned yet, the status will be:
-
Other Cases
- In all other cases, the reviews status is used.
A discount is considered requested when:
- For popup cities that require approval: If the scholarship request field is set
- For popup cities that don't require approval: If the applicant is a renter OR has a scholarship request
The status calculation is implemented in the calculate_status function in app/api/applications/crud.py. This function:
- Takes the application object, requires_approval flag, and optional reviews_status as inputs
- Determines if a discount was requested using the
_requested_a_discountfunction - Applies the rules above to calculate the appropriate status
- Returns both the calculated status and a boolean indicating if a discount was requested
The discount request determination is implemented in the _requested_a_discount function, which checks:
- If the popup city requires approval: Returns application.scholarship_request
- If the popup city doesn't require approval: Returns application.is_renter OR application.scholarship_request
This logic ensures applications flow through the correct statuses based on their requirements and submission state.
The reviews status referenced above is a calculated column (calculated_status) in NocoDB. This status is determined by a formula that evaluates reviewer inputs and application state:
- If the applicant is not attending (
not_attending == 1), status isWITHDRAWN - If the application is auto-approved (
auto_approved == 1), status isACCEPTED - For applications requiring review:
- Status is
ACCEPTEDif:- At least one reviewer gave a "strong yes", OR
- At least two reviewers gave a "yes"
- Status is
REJECTEDif:- At least one reviewer gave a "strong no", OR
- At least two reviewers gave a "no"
- Otherwise, no status is assigned (empty string)
- Status is
The actual formula used in NocoDB is:
IF(({not_attending} == 1), "withdrawn",
IF(({auto_approved} == 1), "accepted",
IF(OR(
OR(
AND(({janine_review} == "yes"),
OR(({timour_review} == "yes"), ({tela_review} == "yes"), ({sophie_review} == "yes"), ({devon_review} == "yes"), ({katherine_review} == "yes"))),
AND(({timour_review} == "yes"),
OR(({tela_review} == "yes"), ({sophie_review} == "yes"), ({devon_review} == "yes"), ({katherine_review} == "yes"))),
AND(({tela_review} == "yes"),
OR(({sophie_review} == "yes"), ({devon_review} == "yes"), ({katherine_review} == "yes"))),
AND(({sophie_review} == "yes"),
OR(({devon_review} == "yes"), ({katherine_review} == "yes")))
),
OR(({janine_review} == "strong yes"), ({timour_review} == "strong yes"), ({tela_review} == "strong yes"),
({sophie_review} == "strong yes"), ({devon_review} == "strong yes"), ({katherine_review} == "strong yes"))
), "accepted",
IF(OR(
OR(
AND(({janine_review} == "no"),
OR(({timour_review} == "no"), ({tela_review} == "no"), ({sophie_review} == "no"), ({devon_review} == "no"), ({katherine_review} == "no"))),
AND(({timour_review} == "no"),
OR(({tela_review} == "no"), ({sophie_review} == "no"), ({devon_review} == "no"), ({katherine_review} == "no"))),
AND(({tela_review} == "no"),
OR(({sophie_review} == "no"), ({devon_review} == "no"), ({katherine_review} == "no"))),
AND(({sophie_review} == "no"),
OR(({devon_review} == "no"), ({katherine_review} == "no")))
),
OR(({janine_review} == "strong no"), ({timour_review} == "strong no"), ({tela_review} == "strong no"),
({sophie_review} == "strong no"), ({devon_review} == "strong no"), ({katherine_review} == "strong no"))
), "rejected", "")
)
)
)
The formula above can be modified as needed to adjust the review logic or accommodate changes in the review process.