feat: add feedback feature for students and teachers#455
Conversation
|
@weiwei-gitch is attempting to deploy a commit to the 007's projects Team on Vercel. A member of the Team first needs to authorize it. |
Thanks for creating a PR for your Issue!
|
| if session.get("admin_logged_in") != True: | ||
| return redirect(url_for("admin_login")) |
There was a problem hiding this comment.
admin_feedback uses nonexistent session key, always redirects admins away
app.py's admin login (line 870) sets session["logged_in"] and session["admin_id"], never session["admin_logged_in"]. The admin_feedback route checks session.get("admin_logged_in") != True — a key that is never set — so every admin request is redirected to admin_login, making the page permanently inaccessible.
| if session.get("admin_logged_in") != True: | |
| return redirect(url_for("admin_login")) | |
| if not session.get("logged_in") or not session.get("admin_id"): | |
| return redirect(url_for("admin_login")) |
Prompt to fix with AI
Copy this prompt into your AI coding assistant to fix this issue.
Replace the auth check in admin_feedback() at line 1658 from `session.get("admin_logged_in") != True` to `not session.get("logged_in") or not session.get("admin_id")`, matching the pattern used by all other admin-protected routes in the file (see lines 286, 342).
| @@ -0,0 +1,50 @@ | |||
| {% extends "base.html" %} | |||
There was a problem hiding this comment.
admin_feedback.html extends public base.html instead of admin layout
All other admin pages (admin_dashboard.html, admin_users.html, etc.) use a self-contained HTML structure with an admin sidebar/nav, not base.html. admin_feedback.html extends base.html, rendering it with the public marketing nav (Student/Teacher login, FAQ, Feedback links) rather than the admin UI chrome.
Prompt to fix with AI
Copy this prompt into your AI coding assistant to fix this issue.
Change admin_feedback.html to extend the same base admin template used by other admin pages (admin_dashboard.html, admin_users.html). Wrap its content in the same sidebar/layout structure those templates use, rather than extending the public base.html.
Confidence Score: 2/5 - Changes NeededNot safe to merge — this PR introduces a feedback feature for students and teachers but contains a critical authentication bug in Key Findings:
Files requiring special attention
|
|
I will immediately start work on this , i am sorry for this incomplete issue |
Which issue does this PR close?
Rationale for this change
The platform had no way for students or teachers to share thoughts, report issues, or suggest improvements from within the platform. This PR adds a dedicated Feedback feature to make the platform more community-driven.
What changes are included in this PR?
feedbacktable to the database viainit_db()inapp.py/feedbackroute (GET/POST) for submitting feedback/admin/feedbackroute for admins to view all submissionstemplates/feedback.html— feedback form with role selector, name, email, feedback type, message textarea, and star rating (1–5)templates/admin_feedback.html— admin table view of all feedbackbase.htmlAre these changes tested?
Are there any user-facing changes?