decorator: Don't block ZulipElectron name in json views.

This fixes the logging of the ZulipElectron client in server logs.
Message sending is still logged as "website"; that will be fixed soon.
This commit is contained in:
Tim Abbott
2017-02-17 13:12:10 -08:00
parent 2dc553df0a
commit c9126e772e

View File

@@ -136,7 +136,7 @@ def get_client_name(request, is_json_view):
# We could check for a browser's name being "Mozilla", but
# e.g. Opera and MobileSafari don't set that, and it seems
# more robust to just key off whether it was a json view
if user_agent["name"] != "ZulipDesktop" and is_json_view:
if is_json_view and user_agent["name"] not in {"ZulipDesktop", "ZulipElectron"}:
# Avoid changing the client string for browsers Once this
# is out to prod, we can name the field to something like
# Browser for consistency.