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

Done #745

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Done #745

wants to merge 10 commits into from

Conversation

antonver
Copy link

@antonver antonver commented Aug 4, 2024

No description provided.

taxi/views.py Outdated
Comment on lines 56 to 75


def login_view(request: HttpRequest) -> HttpResponse:
if request.method == "GET":
form = AuthenticationForm()
return render(request, "registration/login.html", {"form": form})
elif request.method == "POST":
form = AuthenticationForm(data=request.POST)
if form.is_valid():
user = form.get_user()
login(request, user)
return HttpResponseRedirect(reverse("taxi:index"))
else:
return render(request, "registration/login.html", {"form": form})


def logout_view(request) -> HttpResponse:
form = AuthenticationForm()
logout(request)
return render(request, "registration/logged_out.html", {"form": form})
Copy link

Choose a reason for hiding this comment

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

These two views are unnecessary here, please use the logic and logout provided by Django out of the box, don't write your own view.

Comment on lines -23 to -25
SECRET_KEY = (
SECRET_KEY = \
"django-insecure-8ovil3xu6=eaoqd#-#&ricv159p0pypoh5_lgm*)-dfcjqe=yc"
)
Copy link

Choose a reason for hiding this comment

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

Why you change this?
Better to use () then \

Copy link
Author

Choose a reason for hiding this comment

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

Flake8 said that it is too much of symbols

@antonver antonver requested a review from vsmutok August 5, 2024 12:50
requirements.txt Outdated
flake8==5.0.4
flake8-quotes==3.3.1
flake8-variables-names==0.0.5
pep8-naming==0.13.2

django-debug-toolbar~=4.4.6

Choose a reason for hiding this comment

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

add a blank line

{% extends "base.html" %}
{% block content %}
<p>You logged out of the site, to go back use this link:<a href="{% url "login" %}" class="btn btn-primary">Login</a></p>
{% endblock %}

Choose a reason for hiding this comment

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

the same here

requirements.txt Outdated
flake8==5.0.4
flake8-quotes==3.3.1
flake8-variables-names==0.0.5
pep8-naming==0.13.2

Choose a reason for hiding this comment

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

remove an unnecessary blank line

Copy link

@viktoria-rybenchuk viktoria-rybenchuk left a comment

Choose a reason for hiding this comment

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

GJ!

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.

3 participants