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,8 +94,13 @@ class index:
|
||||||
|
|
||||||
if method == 'create':
|
if method == 'create':
|
||||||
i = web.input()
|
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)
|
selected = get_pair_from_url(i.base_url)
|
||||||
|
|
||||||
|
|
Reference in a new issue