Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
cookie committed Sep 21, 2018
1 parent 1a4c7b0 commit 7bbe297
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/core/api/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
Account,
Todolist,
grained,
query_order
query_order,
globalpermissions
)

CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
Expand Down Expand Up @@ -113,7 +114,8 @@ def post(self, request, args=None):
realname = request.data['realname']
department = request.data['department']
auth_group = ','.join(json.loads(request.data['auth_group']))
_send_mail = send_email(to_addr=email)
tag = globalpermissions.objects.filter(authorization='global').first()
_send_mail = send_email(to_addr=email, ssl=tag.message['ssl'])
_status, _message = _send_mail.email_check()
if _status != 200:
return Response(data=_message)
Expand Down Expand Up @@ -315,6 +317,7 @@ def post(self, request, args: str = None):
permissions = authenticate(username=user, password=password)
if permissions is not None and permissions.is_active:
token = jwt_encode_handler(jwt_payload_handler(permissions))
return Response({'token': token, 'res': '', 'permissions': permissions.group, 'real_name': permissions.real_name})
return Response(
{'token': token, 'res': '', 'permissions': permissions.group, 'real_name': permissions.real_name})
else:
return HttpResponse(status=400)

0 comments on commit 7bbe297

Please sign in to comment.