Skip to content

Commit

Permalink
Merge pull request IMGIITRoorkee#60 from dhokladrijaa/duplicate-site-…
Browse files Browse the repository at this point in the history
…entry-warning#31

Warn users when adding duplicate site entries | Closes issue IMGIITRoorkee#31
  • Loading branch information
IronJam11 authored Dec 18, 2024
2 parents d8545c1 + 0770aa9 commit 319276c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def load_password_file(self, path):
self.password_dict[site] = Fernet(self.key).decrypt(encrypted.encode()).decode()

def add_password(self, site, password):
if site in self.password_dict:
print(f"Warning: A password for the site '{site}' already exists.")
return
self.password_dict[site] = password
if self.password_file is not None:
with open(self.password_file, 'a+') as f:
Expand Down

0 comments on commit 319276c

Please sign in to comment.