Commit 3f11ab14 by Matt Drayer

Merge pull request #314 from edx-solutions/ziafazal/api-update-user-title-when-empty

ziafazal/api-update-user-title-when-empty:accept empty user title
parents 546ae2c0 20f972b4
......@@ -231,7 +231,7 @@ class CoursesApiTests(TestCase):
)
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
......
......@@ -461,6 +461,7 @@ class UsersApiTests(TestCase):
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)
......
......@@ -564,9 +564,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