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

add message incorrect password #172

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
12 changes: 10 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def home():
def contact_us():
return render_template('/contact_us.html')

@app.route('/send_message',methods=['GET', 'POST'])

@app.route('/send_message', methods=['GET', 'POST'])
def send_message():
if request.method == 'POST':
userDetails = request.form
Expand All @@ -52,7 +53,6 @@ def send_message():
return render_template('/send_message.html')



def authenticate_user(username, password):
if check_username(username):
if check_password(username, password):
Expand Down Expand Up @@ -119,3 +119,11 @@ def check_username(username):
else:
# the user exists
return True


def incorrect_password():
if request.method == 'POST':
return render_template('Home.html')
if password is not correct:
flash("Oh no! The password you entered is incorrect. Please try again.")
return render_template('/incorrectPassword.html')
19 changes: 19 additions & 0 deletions templates/incorrectPassword.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<html>
<header>

</header>
<body>
<div class="container-fluid" style="min-height:100% width:80%">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close">Close</button>{{message}}
</div>
{% end for %}
{% end if %}
{% end with %}
{% block body %}{% end block %}
</div>
</body>
</html>