Refind check for existing alias on server and in db
This commit is contained in:
parent
967390ddfa
commit
1c7dd7e44d
@ -29,7 +29,7 @@ database = filepath.joinpath('malias.db')
|
||||
logfile = filepath.joinpath('malias.log')
|
||||
Path(filepath).mkdir(parents=True, exist_ok=True)
|
||||
logging.basicConfig(filename=logfile,level=logging.INFO,format='%(message)s')
|
||||
app_version = '0.3.1'
|
||||
app_version = '0.3.2'
|
||||
|
||||
|
||||
def get_latest_release():
|
||||
@ -116,7 +116,6 @@ def get_settings(kind):
|
||||
|
||||
|
||||
def get_api():
|
||||
latest_release = get_latest_release()
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('SELECT api FROM apikey')
|
||||
apikey = cursor.fetchone()[0]
|
||||
@ -299,11 +298,11 @@ def checklist(alias):
|
||||
remoteData = json.loads(remote)
|
||||
i = 0
|
||||
for search in remoteData:
|
||||
if alias in remoteData[i]['address'] or alias in remoteData[i]['goto']:
|
||||
if alias == remoteData[i]['address'] or alias == remoteData[i]['goto']:
|
||||
alias_exist = True
|
||||
i=i+1
|
||||
cursor = conn.cursor()
|
||||
cursor.execute('SELECT count(*) FROM aliases where alias like ? or goto like ?', (alias,alias,))
|
||||
cursor.execute('SELECT count(*) FROM aliases where alias == ? or goto == ?', (alias,alias,))
|
||||
count = cursor.fetchone()[0]
|
||||
if count >= 1 :
|
||||
alias_exist = True
|
||||
|
Loading…
Reference in New Issue
Block a user