Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
flake8 fixes
  • Loading branch information
noga-acumen committed Oct 1, 2021
commit b2e4a42986bb16fbb6c6228e7fdf4c91eed4b4b3
1 change: 0 additions & 1 deletion lms/lmsweb/forms/login.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from flask_babel import gettext as _ # type: ignore
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField
from wtforms.fields.simple import PasswordField
Expand Down
2 changes: 1 addition & 1 deletion lms/lmsweb/forms/reset_password.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from flask_babel import gettext as _ # type: ignore
from flask_wtf import FlaskForm
from wtforms import StringField
from wtforms.fields.simple import PasswordField
from wtforms import PasswordField
Comment thread
NogaOs marked this conversation as resolved.
from wtforms.validators import Email, EqualTo, InputRequired, Length


Expand Down
2 changes: 1 addition & 1 deletion lms/lmsweb/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def login(login_message: Optional[str] = None):
login_message = request.args.get('login_message')
if not form.validate_on_submit():
return render_template(
'login.html', form=form, login_message=login_message
'login.html', form=form, login_message=login_message,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we keep the login message from the last page request or generate new one? (I might have missed something in the logic here)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think I changed anything meaningful here. Me missing something in the logic here would be more probable :P
From just messing around with the system, it seems to work - what should I fix here?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Try to create a form validator instead of the auth method and because of that you would remove 113-122 lines.
You can take a look in the lmsweb/tools/validators.py and the auth method in order to create the validator

)

username = form.username.data
Expand Down