views: remove now-unused tutorial message sending capabilities.

(imported from commit 65d14bf469f64b47cf682f4fb36946c6d841eebd)
This commit is contained in:
Jessica McKellar 2013-06-27 10:44:05 -04:00
parent dbbc555a52
commit 46afe3be69
3 changed files with 0 additions and 45 deletions

View File

@ -100,7 +100,6 @@ urlpatterns += patterns('zephyr.views',
url(r'^json/get_members$', 'json_get_members'),
url(r'^json/update_active_status$', 'json_update_active_status'),
url(r'^json/get_active_statuses$', 'json_get_active_statuses'),
url(r'^json/tutorial_send_message$', 'json_tutorial_send_message'),
url(r'^json/tutorial_status$', 'json_tutorial_status'),
url(r'^json/change_enter_sends$', 'json_change_enter_sends'),
url(r'^json/get_profile$', 'json_get_profile'),

View File

@ -118,13 +118,6 @@ class UserProfile(AbstractBaseUser):
# completed.
onboarding_steps = models.TextField(default=ujson.dumps([]))
def tutorial_stream_name(self):
# If you change this, you need to change the corresponding
# client-computed version of it in tutorial.js
long_name = "tutorial-%s" % (self.email.split('@')[0],)
short_name = long_name[:Stream.MAX_NAME_LENGTH]
return short_name
objects = UserManager()
def __repr__(self):

View File

@ -1045,43 +1045,6 @@ def create_mirrored_message_users(request, user_profile, recipients):
sender = get_user_profile_by_email(sender_email)
return (True, sender)
@authenticated_json_post_view
@has_request_variables
def json_tutorial_send_message(request, user_profile,
message_type_name = REQ('type'),
subject_name = REQ('subject', lambda x: x.strip(), None),
message_content = REQ('content')):
"""
This function, used by the onboarding tutorial, causes the
Tutorial Bot to send you the message you pass in here.
(That way, the Tutorial Bot's messages to you get rendered
by the server and therefore look like any other message.)
"""
sender_name = "humbug+tutorial@humbughq.com"
if message_type_name == 'private':
# For now, we discard the recipient on PMs; the tutorial bot
# can only send to you.
internal_send_message(sender_name,
"private",
user_profile.email,
"",
message_content,
realm=user_profile.realm)
return json_success()
elif message_type_name == 'stream':
tutorial_stream_name = user_profile.tutorial_stream_name()
## TODO: For open realms, we need to use the full name here,
## so that me@gmail.com and me@hotmail.com don't get the same stream.
internal_send_message(sender_name,
"stream",
tutorial_stream_name,
subject_name,
message_content,
realm=user_profile.realm)
return json_success()
return json_error('Bad data passed in to tutorial_send_message')
@authenticated_json_post_view
@has_request_variables
def json_tutorial_status(request, user_profile, status=REQ('status')):