Skip to content

add_tag view crashes with TypeError, Flask view incorrectly accepts request parameter #840

@System625

Description

@System625

Description

The add_tag view function in tahrir/views/admin.py (line 227) is defined as:

def add_tag(request):

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

  1. Log in as an admin
  2. Navigate to a badge page
  3. Attempt to add a tag via the form (POST to /add_tag)
  4. 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.

Metadata

Metadata

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions