Skip to content

Remove debug print() statement from json_report_year view #872

@zsklav

Description

@zsklav

A leftover debug print() statement exists in the json_report_year view function at tahrir/views/report.py line 148:

print("Start: ", start, " End: ", stop)

This prints start and end dates to stdout on every request to the weekly leaderboard JSON endpoint (/json/report/y//m//d//week), polluting the server logs in production.

Expected behavior

No debug output should appear in the server console. If logging is needed here, it should use Python's logging module instead.

Proposed fix

Remove the print() call on line 148:

  if request.path.endswith("/week"):
      # Weekly report
      start = get_start_week(year, month, day)
      stop = start + timedelta(days=6)
     print("Start: ", start, " End: ", stop)
  elif day is not None:

Metadata

Metadata

Type

No fields configured for Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions