Commit 2f4defa6 by Zia Fazal Committed by Jonathan Piacenti

ziafazal/api-update-user-time-when-emtpy:accept empty user title

added comment
parent 71aacb36
......@@ -227,7 +227,7 @@ class CoursesApiTests(ModuleStoreTestCase):
)
self.test_course_id = unicode(self.course.id)
self.test_bogus_course_id = 'i4x://foo/bar/baz'
self.test_bogus_course_id = 'foo/bar/baz'
self.test_course_name = self.course.display_name
self.test_course_number = self.course.number
self.test_course_org = self.course.org
......
......@@ -458,6 +458,7 @@ class UsersApiTests(ModuleStoreTestCase):
data["country"] = "US"
data["year_of_birth"] = "1990"
data["title"] = ""
response = self.do_post(test_uri, data)
self.assertEqual(response.status_code, 200)
response = self.do_get(test_uri)
......
......@@ -563,9 +563,9 @@ class UsersDetail(SecureAPIView):
gender = request.DATA.get('gender')
if gender:
existing_user_profile.gender = gender
title = request.DATA.get('title')
if title:
existing_user_profile.title = title
# Empty title is also allowed
title = request.DATA.get('title', None)
existing_user_profile.title = title
avatar_url = request.DATA.get('avatar_url')
if avatar_url:
existing_user_profile.avatar_url = avatar_url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment