message: Remove unused old gravatar_hash field from message dicts.

This was deprecated and replaced some 4 years ago.
This commit is contained in:
Tim Abbott 2017-05-09 22:20:47 -07:00
parent e3505bd5ae
commit 9f7236eec1
6 changed files with 1 additions and 9 deletions

View File

@ -83,7 +83,6 @@
'sender_short_name': 'othello-bot', 'sender_short_name': 'othello-bot',
'sender_realm_str': 'example', 'sender_realm_str': 'example',
'content': 'Something is rotten in the state of Denmark.', 'content': 'Something is rotten in the state of Denmark.',
'gravatar_hash': '17d93357cca1e793739836ecbc7a9bf7',
'recipient_id': 12314, 'recipient_id': 12314,
'client': 'website', 'client': 'website',
'subject_links': [], 'subject_links': [],
@ -108,7 +107,6 @@
'sender_short_name': 'othello-bot', 'sender_short_name': 'othello-bot',
'sender_realm_str': 'example', 'sender_realm_str': 'example',
'content': 'I come not, friends, to steal away your hearts.', 'content': 'I come not, friends, to steal away your hearts.',
'gravatar_hash': '17d93357cca1e793739836ecbc7a9bf7',
'recipient_id': 18391, 'recipient_id': 18391,
'client': 'website', 'client': 'website',
'subject_links': [], 'subject_links': [],

View File

@ -79,7 +79,7 @@ for msg in result['messages']:
if msg['type'] != 'stream': if msg['type'] != 'stream':
continue continue
# Remove extraneous metadata # Remove extraneous metadata
for k in ['flags', 'edit_history', 'subject_links', 'gravatar_hash', for k in ['flags', 'edit_history', 'subject_links',
'avatar_url', 'recipient_id', 'sender_short_name', 'avatar_url', 'recipient_id', 'sender_short_name',
'content_type', 'client', 'sender_realm_str', 'id', 'type']: 'content_type', 'client', 'sender_realm_str', 'id', 'type']:
msg.pop(k, None) msg.pop(k, None)

View File

@ -29,7 +29,6 @@ import requests
from django.core import mail from django.core import mail
from django.conf import settings from django.conf import settings
from zerver.lib.avatar_hash import gravatar_hash
from markdown.extensions import codehilite from markdown.extensions import codehilite
from zerver.lib.bugdown import fenced_code from zerver.lib.bugdown import fenced_code
from zerver.lib.bugdown.fenced_code import FENCE_RE from zerver.lib.bugdown.fenced_code import FENCE_RE

View File

@ -10,7 +10,6 @@ from six import binary_type
from typing import Set, Text from typing import Set, Text
from zerver.lib.avatar import avatar_url_from_dict from zerver.lib.avatar import avatar_url_from_dict
from zerver.lib.avatar_hash import gravatar_hash
import zerver.lib.bugdown as bugdown import zerver.lib.bugdown as bugdown
from zerver.lib.cache import cache_with_key, to_dict_cache_key from zerver.lib.cache import cache_with_key, to_dict_cache_key
from zerver.lib.request import JsonableError from zerver.lib.request import JsonableError
@ -194,7 +193,6 @@ class MessageDict(object):
recipient_id = recipient_id, recipient_id = recipient_id,
subject = subject, subject = subject,
timestamp = datetime_to_timestamp(pub_date), timestamp = datetime_to_timestamp(pub_date),
gravatar_hash = gravatar_hash(sender_email), # Deprecated June 2013
avatar_url = avatar_url, avatar_url = avatar_url,
client = sending_client_name) client = sending_client_name)

View File

@ -444,7 +444,6 @@ class EventsRegisterTest(ZulipTestCase):
('content', check_string), ('content', check_string),
('content_type', equals('text/html')), ('content_type', equals('text/html')),
('display_recipient', check_string), ('display_recipient', check_string),
('gravatar_hash', check_string),
('is_mentioned', check_bool), ('is_mentioned', check_bool),
('reactions', check_list(None)), ('reactions', check_list(None)),
('recipient_id', check_int), ('recipient_id', check_int),

View File

@ -413,8 +413,6 @@ class GetOldMessagesTest(ZulipTestCase):
"avatar_url", "recipient_id", "sender_full_name", "avatar_url", "recipient_id", "sender_full_name",
"sender_short_name", "timestamp", "reactions"): "sender_short_name", "timestamp", "reactions"):
self.assertIn(field, message) self.assertIn(field, message)
# TODO: deprecate soon in favor of avatar_url
self.assertIn('gravatar_hash', message)
return result return result