Skip to content

Commit

Permalink
Merge pull request #17 from ArpithaVijayakumar/arpitha-dev
Browse files Browse the repository at this point in the history
Arpitha dev
  • Loading branch information
ArpithaVijayakumar authored Nov 2, 2021
2 parents 84862ad + 657d996 commit a98abb6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
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

0 comments on commit a98abb6

Please sign in to comment.