Description
The add_tag view function in tahrir/views/admin.py (line 227) is defined as:
Flask view functions do not receive request as a positional argument — it should be accessed via from flask import request (which is already imported at the top of the file). This causes the endpoint to always crash with a TypeError because Flask passes zero positional arguments to the view function.
Steps to Reproduce
- Log in as an admin
- Navigate to a badge page
- Attempt to add a tag via the form (POST to
/add_tag)
- The endpoint crashes with:
TypeError: add_tag() missing 1 required positional argument: 'request'
Expected Behavior
The tag should be added to the badge and the user should be redirected back to the badge page.