Skip to content

Commit

Permalink
Minor changes on set username password flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mhbahmani committed Oct 5, 2023
1 parent e9c27de commit c05b26d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/reserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,19 @@ def handle_username_input(self, update, context):

def handle_password_input(self, update, context):
password = update.message.text
update.message.reply_text(messages.username_and_password_saved_message)
message_id = update.message.reply_text(messages.username_and_password_saved_message).message_id
if not Dining.check_username_and_password(context.user_data['username'], password):
update.message.reply_text(messages.username_or_password_incorrect_message)
context.bot.edit_message_text(
text=messages.username_or_password_incorrect_message,
chat_id=update.message.chat_id,
message_id=message_id,
)
else:
update.message.reply_text(messages.username_and_password_correct_message)
context.bot.edit_message_text(
text=messages.username_and_password_correct_message,
chat_id=update.message.chat_id,
message_id=message_id,
)
self.db.update_user_info({
"user_id": update.message.chat.id,
"username": update.effective_user.username,
Expand Down

0 comments on commit c05b26d

Please sign in to comment.