insert only if it doesnt already exist
This commit is contained in:
parent
6d16567b68
commit
f3783dc307
1 changed files with 7 additions and 2 deletions
|
@ -94,6 +94,11 @@ class index:
|
|||
|
||||
if method == 'create':
|
||||
i = web.input()
|
||||
|
||||
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)
|
||||
|
||||
|
|
Reference in a new issue