mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 02:49:27 +01:00
Aka: Add some redundant constraints, just in case.
This commit is contained in:
parent
e9cbb1f60b
commit
b7a9569f72
@ -54,9 +54,10 @@ if sqlalchemy:
|
||||
__tablename__ = 'aliases'
|
||||
|
||||
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)
|
||||
name = sqlalchemy.Column(sqlalchemy.String)
|
||||
name = sqlalchemy.Column(sqlalchemy.String, unique=True)
|
||||
alias = sqlalchemy.Column(sqlalchemy.String)
|
||||
|
||||
|
||||
def __init__(self, name, alias):
|
||||
self.name = name
|
||||
self.alias = alias
|
||||
@ -254,6 +255,8 @@ class Aka(callbacks.Plugin):
|
||||
if self.__parent.isCommandMethod(name):
|
||||
raise AliasError(_('You can\'t overwrite commands in '
|
||||
'this plugin.'))
|
||||
if self._db.has_aka(channel, name):
|
||||
raise AliasError(_('This Aka already exists.'))
|
||||
biggestDollar = findBiggestDollar(alias)
|
||||
biggestAt = findBiggestAt(alias)
|
||||
wildcard = '$*' in alias
|
||||
|
Loading…
Reference in New Issue
Block a user