Skip to content

Version 2#7

Open
VaSillii wants to merge 5 commits intomasterfrom
version-2
Open

Version 2#7
VaSillii wants to merge 5 commits intomasterfrom
version-2

Conversation

@VaSillii
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread api/views.py
res = {'error': 'please provide a email and a password',
'email': email,
'password': password}
return Response(res, status=status.HTTP_204_NO_CONTENT)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь нужен другой код. 2xx - успешные ответы. В частности 204 - успешный ответ без тела (например при удалении объекта). Здесь явно невалидная ситуация - нужно возвращать 4xx код

Comment thread api_core/urls.py
re_path(r'^api-auth/', include('rest_framework.urls')),
path('visits/', include((visits_api_urls, 'visits'))),
path('mac_addr/create', ApiCreateView.as_view()),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А зачем оба варианта авторизации сразу?

Comment thread api/views.py
password = request.data['password']

user = UserAccount.objects.get(email=email)
if user:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А где проверка пароля то? сейчас авторизация только по username по сути

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants