Skip to content

Commit

Permalink
fixed errors with adding and reading passwords
Browse files Browse the repository at this point in the history
  • Loading branch information
Equat-ion committed Jan 21, 2025
1 parent aa26be8 commit c914672
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/core_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def view_passwd(self):
print(f"Service: {entry["service"]}, Username: {entry["userid"]}, Password: {decrypted_passwd}")

def update_passwd(self, service, userid, new_password):
encrypted_passwd = self.database.encrypt(new_password)
encrypted_passwd = self.encryption.encrypt(new_password)
self.database.update_password(service, userid, encrypted_passwd)

print(f"Password for {service} updated successfully!")
Expand Down
2 changes: 1 addition & 1 deletion core/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def __init__(self, filepath="passwords.json"):

self.filepath = filepath

if not os.path.exists(self.filepath):
if not os.path.exists(self.filepath) or os.path.getsize(self.filepath) == 0:
with open(self.filepath, 'w') as db:
json.dump([], db)

Expand Down

0 comments on commit c914672

Please sign in to comment.