mirror of
https://github.com/iio612/DEFENDER.git
synced 2026-02-13 19:24:23 +00:00
If no fingerprint available, cert command will trigger an error.
This commit is contained in:
@@ -847,12 +847,15 @@ class Irc:
|
|||||||
try:
|
try:
|
||||||
admin_obj = self.Admin.get_admin(fromuser)
|
admin_obj = self.Admin.get_admin(fromuser)
|
||||||
if admin_obj:
|
if admin_obj:
|
||||||
|
if admin_obj.fingerprint is not None:
|
||||||
query = f'UPDATE {self.Config.TABLE_ADMIN} SET fingerprint = :fingerprint WHERE user = :user'
|
query = f'UPDATE {self.Config.TABLE_ADMIN} SET fingerprint = :fingerprint WHERE user = :user'
|
||||||
r = self.Base.db_execute_query(query, {'fingerprint': admin_obj.fingerprint, 'user': admin_obj.account})
|
r = self.Base.db_execute_query(query, {'fingerprint': admin_obj.fingerprint, 'user': admin_obj.account})
|
||||||
if r.rowcount > 0:
|
if r.rowcount > 0:
|
||||||
self.Protocol.send_notice(dnickname, fromuser, f'[ {GREEN}CERT{NOGC} ] Your new fingerprint has been attached to your account. {admin_obj.fingerprint}')
|
self.Protocol.send_notice(dnickname, fromuser, f'[ {GREEN}CERT{NOGC} ] Your new fingerprint has been attached to your account. {admin_obj.fingerprint}')
|
||||||
else:
|
else:
|
||||||
self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] Impossible to add your fingerprint.{admin_obj.fingerprint}')
|
self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] Impossible to add your fingerprint.{admin_obj.fingerprint}')
|
||||||
|
else:
|
||||||
|
self.Protocol.send_notice(dnickname, fromuser, f'[ {RED}CERT{NOGC} ] There is no fingerprint to add.')
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.Logs.error(e)
|
self.Logs.error(e)
|
||||||
|
|||||||
Reference in New Issue
Block a user