Compare commits

...

1 Commits

Author SHA1 Message Date
Ilya Etingof 3c16a9a8a1 Treat `None` community name/index as an empty string 2018-08-28 09:36:59 +02:00
2 changed files with 6 additions and 0 deletions

View File

@ -32,6 +32,9 @@ class CommunityData(object):
def __init__(self, communityName, mpModel=1):
self.mpModel = mpModel
# Treat `None` as an empty string
if communityName is None:
communityName = ''
self.communityName = communityName
def __hash__(self):

View File

@ -107,6 +107,9 @@ class CommunityData(object):
self.contextName = contextName
if tag is not None:
self.tag = tag
# Treat `None` as an empty string
if communityIndex is None:
communityIndex = ''
# a single arg is considered as a community name
if communityName is None:
communityName, communityIndex = communityIndex, None