Skip to content

Commit

Permalink
Merge remote-tracking branch 'Situphen/hotfix-update-requirements' in…
Browse files Browse the repository at this point in the history
…to release-v1.7
  • Loading branch information
SpaceFox committed Apr 14, 2015
2 parents 05ff79e + 3cb1097 commit 7bcb4da
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ https://github.com/zestedesavoir/Python-ZMarkdown/archive/2.6.0-zds.5.zip
easy-thumbnails==2.2

# Api dependencies
djangorestframework==3.0.2
djangorestframework==3.1.1
djangorestframework-xml==1.0.1
django-filter==0.8
django-oauth-toolkit==0.7.2
drf-extensions==0.2.6
Expand Down
6 changes: 3 additions & 3 deletions zds/member/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def update(self, instance, validated_data):
"""
Update and return an existing `Profile` instance, given the validated data.
"""
instance.user.username = validated_data.get('user').get('username',
instance.user.username) or instance.user.username
instance.user.email = validated_data.get('user').get('email', instance.user.email) or instance.user.email
if validated_data.get('user') is not None:
instance.user.username = validated_data.get('user').get('username', instance.user.username)
instance.user.email = validated_data.get('user').get('email', instance.user.email)
instance.site = validated_data.get('site', instance.site) or instance.site
instance.avatar_url = validated_data.get('avatar_url', instance.avatar_url) or instance.avatar_url
instance.biography = validated_data.get('biography', instance.biography) or instance.biography
Expand Down
3 changes: 1 addition & 2 deletions zds/member/api/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def test_register_new_user_with_username_start_and_end_with_space(self):
'password': 'azerty'
}
response = self.client.post(reverse('api-member-list'), data)
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertIsNotNone(response.data.get('username'))
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

def test_register_new_user_without_email(self):
"""
Expand Down
6 changes: 4 additions & 2 deletions zds/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,15 @@
),
'DEFAULT_PARSER_CLASSES': (
'rest_framework.parsers.JSONParser',
'rest_framework.parsers.XMLParser',
#'rest_framework.parsers.XMLParser',
'rest_framework_xml.parsers.XMLParser',
'rest_framework.parsers.FormParser',
'rest_framework.parsers.MultiPartParser',
),
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.XMLRenderer',
#'rest_framework.renderers.XMLRenderer',
'rest_framework_xml.renderers.XMLRenderer',
'rest_framework.renderers.BrowsableAPIRenderer',
),
'DEFAULT_THROTTLE_CLASSES': (
Expand Down

0 comments on commit 7bcb4da

Please sign in to comment.