Remove models.get_realm(domain).

This commit is contained in:
Rishi Gupta 2017-01-02 22:03:43 -08:00 committed by Tim Abbott
parent 130f981901
commit caccf8ee17
3 changed files with 2 additions and 13 deletions

View File

@ -30,7 +30,7 @@ from zerver.models import Realm, RealmEmoji, Stream, UserProfile, UserActivity,
Client, DefaultStream, UserPresence, Referral, PushDeviceToken, MAX_SUBJECT_LENGTH, \ Client, DefaultStream, UserPresence, Referral, PushDeviceToken, MAX_SUBJECT_LENGTH, \
MAX_MESSAGE_LENGTH, get_client, get_stream, get_recipient, get_huddle, \ MAX_MESSAGE_LENGTH, get_client, get_stream, get_recipient, get_huddle, \
get_user_profile_by_id, PreregistrationUser, get_display_recipient, \ get_user_profile_by_id, PreregistrationUser, get_display_recipient, \
get_realm, get_realm_by_string_id, bulk_get_recipients, \ get_realm_by_string_id, bulk_get_recipients, \
email_allowed_for_realm, email_to_username, display_recipient_cache_key, \ email_allowed_for_realm, email_to_username, display_recipient_cache_key, \
get_user_profile_by_email, get_stream_cache_key, \ get_user_profile_by_email, get_stream_cache_key, \
UserActivityInterval, get_active_user_dicts_in_realm, get_active_streams, \ UserActivityInterval, get_active_user_dicts_in_realm, get_active_streams, \

View File

@ -1213,7 +1213,7 @@ def make_md_engine(key, opts):
def subject_links(realm_id, subject): def subject_links(realm_id, subject):
# type: (int, Text) -> List[Text] # type: (int, Text) -> List[Text]
from zerver.models import get_realm, RealmFilter, realm_filters_for_realm from zerver.models import RealmFilter, realm_filters_for_realm
matches = [] # type: List[Text] matches = [] # type: List[Text]
realm_filters = realm_filters_for_realm(realm_id) realm_filters = realm_filters_for_realm(realm_id)

View File

@ -242,17 +242,6 @@ class Realm(ModelReprMixin, models.Model):
post_save.connect(flush_realm, sender=Realm) post_save.connect(flush_realm, sender=Realm)
# This function is about to be deprecated. Consider using
# get_realm_by_string_id instead.
def get_realm(domain):
# type: (Text) -> Optional[Realm]
if not domain:
return None
try:
return Realm.objects.get(domain__iexact=domain.strip())
except Realm.DoesNotExist:
return None
# Added to assist with the domain to string_id transition. Will eventually # Added to assist with the domain to string_id transition. Will eventually
# be renamed and replace get_realm. # be renamed and replace get_realm.
def get_realm_by_string_id(string_id): def get_realm_by_string_id(string_id):