Skip to content

Commit

Permalink
solved DiptoChakrabarty#44 for LoginForm and PostingForm
Browse files Browse the repository at this point in the history
  • Loading branch information
BIKRAM-SAHA committed Oct 1, 2021
1 parent 15d1ee7 commit 095aebd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions resume/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def validate_email(self,email):
raise ValidationError('Email used already')


class Login(FlaskForm):
class LoginForm(FlaskForm):
email = StringField('Email',
validators=[DataRequired(),Email()])
password = PasswordField('Password',
Expand Down Expand Up @@ -60,7 +60,7 @@ def validate_email(self,new_email):
return ValidationError("Email Id used already")


class posting(FlaskForm):
class PostingForm(FlaskForm):
title = StringField("Name",
validators=[DataRequired(),Length(min=5)])
content = TextAreaField("Description",
Expand Down
4 changes: 2 additions & 2 deletions resume/routes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flask import Flask,make_response,render_template,url_for,flash,redirect,request,abort
from resume.forms import RegistrationForm,Login,account,posting,resumebuilder,useredu,userexp,userpro,usersk,achieve,requestresetform,resetpassword
from resume.forms import RegistrationForm,LoginForm,account,PostingForm,resumebuilder,useredu,userexp,userpro,usersk,achieve,requestresetform,resetpassword
from resume.models import UserModel,education,experience,projects,userdetails,skills,achievements
from resume import app,db, bcrypt , mail
from flask_login import login_user,current_user,logout_user,login_required
Expand Down Expand Up @@ -36,7 +36,7 @@ def register():
def login():
if current_user.is_authenticated:
return redirect(url_for('hello'),code=301)
form = Login()
form = LoginForm()
if form.validate_on_submit():
logged = UserModel.find_by_email(form.email.data)
if logged and bcrypt.check_password_hash(logged.password,form.password.data):
Expand Down

0 comments on commit 095aebd

Please sign in to comment.