Skip to content

feat: add 403 forbidden error handler#348

Open
rudra3007-pro wants to merge 1 commit into
komalharshita:mainfrom
rudra3007-pro:feat/403-error-handler
Open

feat: add 403 forbidden error handler#348
rudra3007-pro wants to merge 1 commit into
komalharshita:mainfrom
rudra3007-pro:feat/403-error-handler

Conversation

@rudra3007-pro
Copy link
Copy Markdown
Contributor

@rudra3007-pro rudra3007-pro commented May 20, 2026

Summary

Added a 403 Forbidden error handler to match the existing 404, 405 and 500 handlers in app.py. Also added a styled templates/403.html page consistent with the rest of the error pages in the app.

Related Issue

Closes #347

Type of Change

  • Feature — adds new functionality

What Was Changed

File Change made
app.py Added forbidden error handler for 403
templates/403.html Added styled 403 error page

How to Test This PR

  1. Clone this branch: git checkout feat/403-error-handler
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. In terminal run: curl -X GET http://127.0.0.1:5000/forbidden
  5. Run the tests: python tests/test_basic.py

Test Results

(.venv) PS C:\Users\AKM\OneDrive\Desktop\new\DevPath> python tests/test_basic.py
PASS test_projects_json_loads
PASS test_each_project_has_required_fields
PASS test_find_project_by_id_found
PASS test_find_project_by_id_missing
PASS test_parse_skills_basic
PASS test_parse_skills_empty_string
PASS test_parse_skills_single_entry
PASS test_score_single_project_full_match
PASS test_score_single_project_no_match
PASS test_get_recommendations_returns_results
PASS test_get_recommendations_max_three
PASS test_get_recommendations_no_match_returns_empty
PASS test_get_recommendations_result_format
PASS test_validate_all_valid
PASS test_validate_missing_skills
PASS test_validate_missing_level
PASS test_validate_missing_interest
PASS test_validate_missing_time
PASS test_validate_all_missing
PASS test_home_route
PASS test_recommend_api_valid
PASS test_recommend_api_missing_field
PASS test_recommend_api_empty_body
PASS test_project_detail_found
PASS test_project_detail_not_found
PASS test_internal_server_error_page
PASS test_view_code_found
PASS test_download_code_found
PASS test_health_check
PASS test_scoring_weights_has_all_keys

30 passed, 0 failed out of 30 tests

Self-Review Checklist

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/403-error-handler
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue

Notes for Reviewer

Follows the exact same pattern as the existing 404, 405 and 500 handlers. The 403.html template reuses the same CSS classes as 404.html, only the error code and message differ.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

@rudra3007-pro is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add 403 Forbidden error handler

1 participant