Skip to content

Commit

Permalink
Merge pull request #13 from ironjunk/12-bug-report-input-fields-accep…
Browse files Browse the repository at this point in the history
…ting-blank-text

Bug Fix (#12)
  • Loading branch information
ironjunk committed Apr 29, 2023
2 parents d22a8d2 + 5113f2f commit a1221e4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from tkinter import Tk, PhotoImage

from manager import check_first_time_setup, init_tables
from gui import gui_first_time_setup, gui_main_menu
from src.manager import check_first_time_setup, init_tables
from src.gui import gui_first_time_setup, gui_main_menu

# ---------- Main

Expand Down
14 changes: 7 additions & 7 deletions gui.py → src/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from tkinter import Label, Entry, Button, OptionMenu, StringVar

import manager as mg
import src.manager as mg
from pyperclip import copy

# ---------- Global Vars
Expand All @@ -21,11 +21,11 @@ def btn_func_store_master_pass(tf_master_password = None, tf_master_password_con

try:
if master_password == master_password_confirm:
if mg.store_master_pass(master_password = master_password):
if master_password != "" and master_password_confirm != "" and mg.store_master_pass(master_password = master_password):
lbl_msg.configure(text = "The master password has been set successfully!\nNote: Kindly restart the app.",
fg = 'green')
else:
lbl_msg.configure(text = "Prohibited keywords not allowed in the text field!", fg = 'red')
lbl_msg.configure(text = "Prohibited keywords/Blank texts not allowed in the text field!", fg = 'red')
else:
lbl_msg.configure(text = "The passwords in both the fields do not match.\nPlease try again.", fg = 'red')
except Exception as exc:
Expand Down Expand Up @@ -59,10 +59,10 @@ def btn_func_store_password(tf_id = None, tf_password = None, tf_master_password

try:
if mg.check_master_pass(master_password = master_password):
if mg.store_password(_id = _id, password = password, master_password = master_password):
if _id != "" and password != "" and mg.store_password(_id = _id, password = password, master_password = master_password):
lbl_msg.configure(text = "Password stored successfully!", fg = 'green')
else:
lbl_msg.configure(text = "Prohibited keywords not allowed in the text field!", fg = 'red')
lbl_msg.configure(text = "Prohibited keywords/Blank texts not allowed in the text field!", fg = 'red')
else:
lbl_msg.configure(text = "Incorrect Master Password!", fg = 'red')
except Exception as exc:
Expand All @@ -76,10 +76,10 @@ def btn_func_update_password(_id = None, tf_password = None, tf_master_password

try:
if mg.check_master_pass(master_password = master_password):
if mg.update_password(_id = _id, password = password, master_password = master_password):
if _id != "" and password != "" and mg.update_password(_id = _id, password = password, master_password = master_password):
lbl_msg.configure(text = "Password updated successfully!", fg = 'green')
else:
lbl_msg.configure(text = "Prohibited keywords not allowed in the text field!", fg = 'red')
lbl_msg.configure(text = "Prohibited keywords/Blank texts not allowed in the text field!", fg = 'red')
else:
lbl_msg.configure(text = "Incorrect Master Password!", fg = 'red')
except Exception as exc:
Expand Down
File renamed without changes.

0 comments on commit a1221e4

Please sign in to comment.