Fixed bug with Named
This commit is contained in:
parent
ea5a21bd89
commit
c27ea2cb7f
|
@ -40,18 +40,17 @@ class Named(CardsObject):
|
||||||
>>> card.colors()
|
>>> card.colors()
|
||||||
"""
|
"""
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
if kwargs.get('exact') is None or kwargs.get('fuzzy') is None:
|
|
||||||
raise Exception('You must provide a `fuzzy` or `exact` parameter.')
|
|
||||||
|
|
||||||
self.dict = {
|
self.dict = {
|
||||||
'set':kwargs.get('set', '')
|
'set':kwargs.get('set', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
if kwargs.get('exact') is not None:
|
if 'exact' in kwargs:
|
||||||
self.dict['exact'] = kwargs.get('exact')
|
self.dict['exact'] = kwargs.get('exact')
|
||||||
|
elif 'fuzzy' in kwargs:
|
||||||
if kwargs.get('fuzzy') is not None:
|
|
||||||
self.dict['fuzzy'] = kwargs.get('fuzzy')
|
self.dict['fuzzy'] = kwargs.get('fuzzy')
|
||||||
|
else:
|
||||||
|
raise Exception('You must provide a `fuzzy` or `exact` parameter.')
|
||||||
|
|
||||||
self.args = urllib.parse.urlencode(self.dict)
|
self.args = urllib.parse.urlencode(self.dict)
|
||||||
self.url = 'cards/named?' + self.args
|
self.url = 'cards/named?' + self.args
|
||||||
|
|
Loading…
Reference in New Issue