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

Arpitha dev #17

Merged
merged 2 commits into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Controller/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ def loginUser():
if(result == 0):
error = "Email does not exits. Please enter a valid email."
return render_template('login.html',loginError = error)
elif(result == 1):
return render_template('home.html', data=data, upcoming_events=upcoming_events)
elif(result == 2):
error="Password incorrect."
return render_template('login.html',loginError = error)
else:
return render_template('home.html', data=result, upcoming_events=upcoming_events)


@home_route.route('/signup', methods=['POST'])
Expand Down
6 changes: 4 additions & 2 deletions DAO/user_dao.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ def create_user(self, name, email, password):
return self.__db.run_query("CALL CreateUser('"+email+"','"+name+"','"+password+"');")

def get_user(self, email, password):
result = self.__db.run_query("SELECT count(*),user_id,email FROM user WHERE email='"+email+"'")
data = {}
result = self.__db.run_query("SELECT count(*),user_id,email,full_name FROM user WHERE email='"+email+"'")
if(result[0][0]==0):
return 0
if(email == result[0][2]):
if(password == self.__db.run_query("SELECT password FROM user_login WHERE user_id="+str(result[0][1]))[0][0]):
return 1
data["ful_name"] = str(result[0][3])
return data
else:
return 2

Expand Down
2 changes: 1 addition & 1 deletion templates/layout/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

<div class="card" style="width: 18rem; text-align: left;">
<div class="card-body">
<h5 class="card-title">Jessica Holds</h5>
<h5 class="card-title">{{data["full_name"]}}</h5>
<div class="row">
<div class="col">
<b>Gender</b>
Expand Down