Skip to content

Renewal approval view calls get_renewal_survey_response for all renewal requests, not just FCA/PCA #827

Description

@matthew-li

When an admin views a renewal request for an allowance type that does not have a renewal survey (e.g., ICA), the approval page logs an exception and shows an error banner:

ValueError: Failed to load survey data for AllocationPeriod 'Fall Semester 2026'
from /etc/coldfront/config/renewal-survey-data.json.
logger: coldfront.core.project.views_.renewal_views.approval_views

Root cause

AllocationRenewalRequestDetailView.get_context_data calls get_renewal_survey_response for every renewal request whenever RENEWAL_SURVEY_ENABLED is true. The renewal survey is only meaningful for FCA (BRC) and PCA (LRC) renewals. ICA and any other allowance types not in the survey data will always produce a ValueError from the backend.

The except Exception block catches it but then calls logger.exception(e) (error-level log) and messages.error(...) (error banner shown to the admin) — neither is appropriate for an expected, non-error condition.

Broader context

The renewal flow is designed for FCA/PCA (AllocationRenewalMixin.__init__ hardcodes this with a TODO). Several behaviors — renewal survey requirement, allocation period naming, period filters — are implicitly FCA/PCA-specific. This issue is one symptom of that incomplete generalization.

Impact

  • Spurious error banner shown to admins reviewing non-FCA/PCA renewal requests
  • Noise in error logs for expected behavior
  • Functionally harmless: survey_response is set to None and the page renders

Fix

Guard the get_renewal_survey_response call in get_context_data on whether the request's computing allowance is renewal-survey-applicable, consistent with how the renewal wizard already restricts itself to FCA/PCA. The guard should use the same predicate (is_renewal_supported() or a new requires_renewal_survey()) so the condition is defined in one place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions