Wikimedia
[Tracker] Fix fatal error thrown by /topics/acks/acks.csv
Problem
If you go to /topics/acks/acks.csv, you will get HTTP 500 error. This task's objective is to fix this error.
Student is expected to send a patch for wikimedia-cz/tracker
repository, hosted at Wikimedia Gerrit. When claiming task on GCI website, student should claim a respective Phabricator task as well.
Traceback
Traceback (most recent call last):
File "/var/www/tracker.wikimedia.cz/deploy/pyenv/lib/python3.5/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "./tracker/views.py", line 944, in topic_content_acks_per_user_csv
response.writerow([row.user, row.grant, row.topic, row.ack_count])
File "./tracker/views.py", line 903, in writerow
self.write(u','.join(map(lambda s: u'"' + str(s).replace('"', "'").replace('\r\n', ' ').replace('\n', ' ').replace('\r', ' ') + u'"', row)))
File "./tracker/views.py", line 903, in <lambda>
self.write(u','.join(map(lambda s: u'"' + str(s).replace('"', "'").replace('\r\n', ' ').replace('\n', ' ').replace('\r', ' ') + u'"', row)))
TypeError: __str__ returned non-string (type User)
Materials
- Tracker in production
- Test Tracker version - you can play with Tracker freely here
- Codebase
Task tags
Students who completed this task
alcarazzam