Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

could not connect a nexus7 with valid user and passwd #181

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions seahub/api2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ def get_token_v2(self, username, platform, device_id, device_name,
raise serializers.ValidationError('invalid device id')

elif platform == 'android':
# android device id is the 64bit secure id, so it must be 16 chars in hex representation
if len(device_id) != 16:
# android device id is the 64bit secure id, so it must be 15 or 16 chars in hex representation
# if hex value starts with 0 device id will be only 15 chars long
if (len(device_id) > 16 | len(device_id) < 15):
raise serializers.ValidationError('invalid device id')
elif platform == 'ios':
if len(device_id) != 36:
Expand Down