[Bugfix] 紧急修复url解析失败错误

pull/530/head
ibuler 2017-01-10 18:03:00 +08:00
parent 8658675f67
commit 8916221bba
3 changed files with 13 additions and 9 deletions

View File

@ -306,7 +306,7 @@ function updateAssetGroups(groups) {
}
function updateAssetSystem(system_users) {
var the_url = "{% url 'api-assets:asset-update-systemusers' pk=asset.id %}";
var the_url = "{% url 'api-assets:asset-update-system-users' pk=asset.id %}";
var body = {
system_users: Object.assign([], system_users)
};

View File

@ -92,16 +92,20 @@ class UserToken(APIView):
permission_classes = (AllowAny,)
def post(self, request):
username = request.data.get('username', '')
email = request.data.get('email', '')
password = request.data.get('password', '')
public_key = request.data.get('public_key', '')
if not request.user:
username = request.data.get('username', '')
email = request.data.get('email', '')
password = request.data.get('password', '')
public_key = request.data.get('public_key', '')
user, msg = check_user_valid(username=username, email=email,
password=password, public_key=public_key)
user, msg = check_user_valid(username=username, email=email,
password=password, public_key=public_key)
else:
user = request.user
msg = None
if user:
token = generate_token(request, user)
return Response({'Token': token, 'key': 'Bearer'}, status=200)
return Response({'Token': token, 'Keyword': 'Bearer'}, status=200)
else:
return Response({'error': msg}, status=406)

View File

@ -17,5 +17,5 @@ requests==2.11.1
itsdangerous==0.24
#python-gssapi==0.6.4
tornado==4.4.2
eventlet==0.19.0
eventlet==0.20.1
django-filter==1.0.0