diff --git a/mysecrets.py b/mysecrets.py index 89edff5..bf35880 100755 --- a/mysecrets.py +++ b/mysecrets.py @@ -94,8 +94,13 @@ class index: if method == 'create': i = web.input() - n = db.insert('passwords', username=i.username, password=i.password, \ - base_url=i.base_url) + + exists = db.select('passwords', where='username="'+i.username+'" and password="' +\ + i.password+'" and base_url="'+i.base_url+'"') + + if not exists: + n = db.insert('passwords', username=i.username, password=i.password, \ + base_url=i.base_url) selected = get_pair_from_url(i.base_url)