Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions templates/student_new_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,11 @@ <h1>Create an Account</h1>
<option disabled selected value="">Select Department</option>
<option value="CSE">CSE</option>
<option value="CSE(E Tech)">CSE(E Tech)</option>
<option value="AI">AI</option>
<option value="ECE">ECE</option>
<option value="EE">EE</option>
<option value="CIVIL">CIVIL</option>
<option value="CHEMICAL">CHEMICAL</option>
Comment on lines +701 to +707

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR BUG Add AI, EE, and CHEMICAL to default_departments in app.py

The admin /admin/departments page counts students via LEFT JOIN student s ON d.dept_code = s.student_dept (app.py:1043), so only dept codes present in the departments table are counted. default_departments (app.py:217–223) includes CIVIL but not AI, EE, or CHEMICAL — students registering with those three departments will be silently invisible in admin department statistics.

Prompt to fix with AI

Copy this prompt into your AI coding assistant to fix this issue.

In `app.py`, around line 217, the `default_departments` list is missing three department codes that were just added to the registration form in `templates/student_new_2.html`. Add the following tuples to the `default_departments` list:
  ("AI", "Artificial Intelligence"),
  ("EE", "Electrical Engineering"),
  ("CHEMICAL", "Chemical Engineering"),
Without these entries, the admin departments statistics page (`/admin/departments`) will silently exclude all students who register with AI, EE, or CHEMICAL because it uses a LEFT JOIN from the `departments` table (keyed on `dept_code`) to the `student` table.

<option value="MECH">MECH</option>
</select>
</div>
Expand Down
Loading