mirror of https://github.com/zulip/zulip.git
Remove models.get_realm(domain).
This commit is contained in:
parent
130f981901
commit
caccf8ee17
|
@ -30,7 +30,7 @@ from zerver.models import Realm, RealmEmoji, Stream, UserProfile, UserActivity,
|
|||
Client, DefaultStream, UserPresence, Referral, PushDeviceToken, MAX_SUBJECT_LENGTH, \
|
||||
MAX_MESSAGE_LENGTH, get_client, get_stream, get_recipient, get_huddle, \
|
||||
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, \
|
||||
get_user_profile_by_email, get_stream_cache_key, \
|
||||
UserActivityInterval, get_active_user_dicts_in_realm, get_active_streams, \
|
||||
|
|
|
@ -1213,7 +1213,7 @@ def make_md_engine(key, opts):
|
|||
|
||||
def subject_links(realm_id, subject):
|
||||
# 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]
|
||||
|
||||
realm_filters = realm_filters_for_realm(realm_id)
|
||||
|
|
|
@ -242,17 +242,6 @@ class Realm(ModelReprMixin, models.Model):
|
|||
|
||||
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
|
||||
# be renamed and replace get_realm.
|
||||
def get_realm_by_string_id(string_id):
|
||||
|
|
Loading…
Reference in New Issue