Commit 5bc0c001 authored by Michal Čihař's avatar Michal Čihař

Store empty language/user in debug info

This helps to see cases when user is not authenticated.

Issue #988
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6b7d1e64
......@@ -32,9 +32,13 @@ class WeblateExceptionReporterFilter(SafeExceptionReporterFilter):
if (hasattr(request, 'user') and
request.user.is_authenticated()):
meta['WEBLATE_USER'] = repr(request.user.username)
else:
meta['WEBLATE_USER'] = ''
if (hasattr(request, 'session') and
'django_language' in request.session):
meta['WEBLATE_LANGUAGE'] = request.session['django_language']
else:
meta['WEBLATE_LANGUAGE'] = ''
for version in get_versions_list():
meta['WEBLATE_VERSION:{0}'.format(version[0])] = version[2]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment