home: Switch invalid pointer logging to by user ID.

This commit is contained in:
Tim Abbott
2019-11-15 16:58:47 -08:00
parent 093e9394dd
commit df90533eef
2 changed files with 2 additions and 2 deletions

View File

@@ -435,7 +435,7 @@ class HomeTest(ZulipTestCase):
self.login(email) self.login(email)
with patch('logging.warning') as mock: with patch('logging.warning') as mock:
result = self._get_home_page() result = self._get_home_page()
mock.assert_called_once_with('hamlet@zulip.com has invalid pointer 999999') mock.assert_called_once_with('User %s has invalid pointer 999999' % (user_profile.id,))
self._sanity_check(result) self._sanity_check(result)
def test_topic_narrow(self) -> None: def test_topic_narrow(self) -> None:

View File

@@ -160,7 +160,7 @@ def home_real(request: HttpRequest) -> HttpResponse:
latest_read = get_usermessage_by_message_id(user_profile, user_profile.pointer) latest_read = get_usermessage_by_message_id(user_profile, user_profile.pointer)
if latest_read is None: if latest_read is None:
# Don't completely fail if your saved pointer ID is invalid # Don't completely fail if your saved pointer ID is invalid
logging.warning("%s has invalid pointer %s" % (user_profile.email, user_profile.pointer)) logging.warning("User %s has invalid pointer %s" % (user_profile.id, user_profile.pointer))
# We pick a language for the user as follows: # We pick a language for the user as follows:
# * First priority is the language in the URL, for debugging. # * First priority is the language in the URL, for debugging.