Skip to content

Implement student profile completion and block PG/PhD registration - #1950

Merged
vikrantwiz02 merged 2 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react
Aug 13, 2026
Merged

Implement student profile completion and block PG/PhD registration#1950
vikrantwiz02 merged 2 commits into
FusionIIIT:prod/acad-reactfrom
vikrantwiz02:prod/acad-react

Conversation

@vikrantwiz02

Copy link
Copy Markdown
Member

This pull request introduces a middleware decorator to restrict certain academic procedures API endpoints to undergraduate students only, blocking access for PG/PhD students. It also adds a mechanism to enforce profile completion for students on their first login, and exposes new endpoints for student profile completion. These changes enhance access control and ensure data integrity for student records.

Access Control and Restrictions:

  • Added a block_pg_phd decorator in views.py to return a 403 error for PG/PhD students attempting to access undergraduate-only academic procedures. This decorator is applied to over 20 student-facing API endpoints, such as course registration, Swayam registration, and course drop/add requests, ensuring these flows are only accessible to eligible undergraduate students. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24]

Student Profile Completion Enforcement:

  • Updated the auth_view in globals/api/views.py to check if a student (UG or PhD) has an incomplete profile (from batch upload) and require them to complete their profile before using the app. This is communicated to the frontend via a new must_complete_profile field in the API response.

API Endpoints for Profile Completion:

  • Added imports and new URL patterns in programme_curriculum/api/urls.py for student profile completion views, enabling students to access and submit their profile completion forms via /student/profile_completion/ and /student/profile_completion/submit/. [1] [2]

- profile_completed flag on Student/Phd batch-upload models (migration 0050)
- /api/auth/me returns must_complete_profile (incomplete batch-upload record)
- student/profile_completion GET (frozen + prefilled editable fields) and
  submit endpoints; server-side validation: required set, Aadhaar 12 digits,
  at least one parent mobile, student mobile != parent, blood-group Other ->
  remarks; photo/signature base64 (png/jpg, size caps) with old-file cleanup;
  sets profile_completed on success
- 10 regression tests
Add a block_pg_phd decorator (403 for PG/PhD) and apply it to the 24
student-facing views behind the pre-registration, final-registration,
Swayam and add/drop/replace tabs, which are hidden from PG/PhD in the UI.
Mirrors the existing _is_phd_student classification used by the frontend.
@vikrantwiz02 vikrantwiz02 self-assigned this Aug 13, 2026
@vikrantwiz02
vikrantwiz02 merged commit 1f7868d into FusionIIIT:prod/acad-react Aug 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant