Skip to content

Feat : More departments added#491

Open
chetisha28 wants to merge 2 commits into
Eswaramuthu:mainfrom
chetisha28:feat/addDepartment
Open

Feat : More departments added#491
chetisha28 wants to merge 2 commits into
Eswaramuthu:mainfrom
chetisha28:feat/addDepartment

Conversation

@chetisha28
Copy link
Copy Markdown

Which issue does this PR close?

What changes are included in this PR?

This PR only adds a few more department options for the user to select.

Are these changes tested?

Yes these changes are tested and only a single file is changed. no unnecessary changes are made.

Signed-off-by: chetisha28 <chetishagemini28@gmail.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@chetisha28 is attempting to deploy a commit to the 007's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

Thanks for creating a PR for your Issue! ☺️

We'll review it as soon as possible.
In the meantime, please double-check the file changes and ensure that all commits are accurate.

If there are any unresolved review comments, feel free to resolve them. 🙌🏼

Comment on lines +701 to +705
<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>
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.

@entelligence-ai-pr-reviews
Copy link
Copy Markdown
Contributor


Confidence Score: 3/5 - Review Recommended

Not safe to merge without review — this PR adds new departments (AI, EE, CHEMICAL) to student_new_2.html but fails to register them in default_departments inside app.py, creating a data consistency bug. The admin /admin/departments page counts students via a LEFT JOIN on dept_code, so departments not seeded in default_departments will be invisible or miscounted in the admin view. The PR's intent — expanding available departments — is straightforward and useful, but the incomplete implementation means the backend and frontend are now out of sync.

Key Findings:

  • The new department codes (AI, EE, CHEMICAL) added to student_new_2.html are not mirrored in default_departments in app.py, meaning the admin department dashboard will fail to display or correctly count students enrolled in these departments via the LEFT JOIN query.
  • This is a logic/data integrity bug, not a cosmetic issue — students selecting these new departments will have their student_dept values unmatched in the departments table, potentially causing silent data loss or misreporting in admin views.
  • The PR correctly updates the student-facing HTML form to expose the new departments, showing the right intent, but the server-side department seed data must be updated in tandem to avoid broken state.
Files requiring special attention
  • templates/student_new_2.html
  • app.py

@entelligence-ai-pr-reviews
Copy link
Copy Markdown
Contributor

EntelligenceAI PR Summary

This PR expands department coverage in both the database seed data and the student registration form.

  • Added 'AI' (Artificial Intelligence), 'EE' (Electrical Engineering), and 'CHEMICAL' (Chemical Engineering) to default_departments in init_db() within app.py
  • Added 'IT' (Information Technology) and 'EEE' (Electrical and Electronics Engineering) as dropdown options in the student creation form (templates/student_new_2.html), positioned before the existing 'ECE' entry

Confidence Score: 5/5 - Safe to Merge

Safe to merge — this PR makes straightforward, additive changes to department seed data and HTML form options with no logic modifications, deletions, or risk surface introduced. The additions to default_departments in init_db() within app.py follow the existing pattern exactly, and the new <option> entries for 'IT' and 'EEE' in templates/student_new_2.html are consistent with the surrounding markup. No review comments were generated and no pre-existing unresolved concerns apply to the changed lines.

Key Findings:

  • The new entries ('AI', 'EE', 'CHEMICAL') added to default_departments in init_db() mirror the established tuple/dict structure used by all existing department seed records, posing no runtime risk.
  • The 'IT' and 'EEE' <option> tags inserted in student_new_2.html are purely additive HTML with no JavaScript, validation logic, or backend contract changes — they cannot break existing functionality.
  • Both changed files have 100% review coverage and zero automated or manual review comments were raised, indicating no identified issues across the diff.
  • 1 previous unresolved comment(s) likely resolved in latest diff (score-only signal; thread status unchanged)

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.

Feature : Add more departments

1 participant