Rename get_class to get_stream.

(imported from commit 4d393f9fcd46847c54c7e0b6b7add219e8e07fe6)
This commit is contained in:
Tim Abbott 2012-10-10 17:00:50 -04:00
parent 4006e4b1ea
commit 003efb84b4
1 changed files with 4 additions and 4 deletions

View File

@ -74,7 +74,7 @@ def strip_html(x):
# FIXME: consider a whitelist
return x.replace('&', '&amp;').replace('<','&lt;').replace('>','&gt;')
def get_class(class_name, realm):
def get_stream(class_name, realm):
stream = Stream.objects.filter(name__iexact=class_name, realm=realm)
if stream:
return stream[0]
@ -451,7 +451,7 @@ def json_remove_subscription(request):
return json_error("Missing subscriptions")
sub_name = request.POST.get('subscription')
stream = get_class(sub_name, user_profile.realm)
stream = get_stream(sub_name, user_profile.realm)
if not stream:
return json_error("Not subscribed, so you can't unsubscribe")
@ -562,7 +562,7 @@ def change_settings(request):
@login_required
def stream_exists(request, stream):
if not valid_stream_name(stream):
return json_error("Invalid characters in class name")
return json_error("Invalid characters in stream name")
return HttpResponse(
bool(get_class(stream,
bool(get_stream(stream,
UserProfile.objects.get(user=request.user).realm)))