Fixes create() method failure where no account was provided.

This commit is contained in:
Johnny 2019-12-04 19:18:39 +00:00
parent 245ddb92c8
commit afabb6ff2a
2 changed files with 12 additions and 3 deletions

View file

@ -2076,9 +2076,10 @@ class DefaultCharacter(DefaultObject):
try:
# Check to make sure account does not have too many chars
if len(account.characters) >= settings.MAX_NR_CHARACTERS:
errors.append("There are too many characters associated with this account.")
return obj, errors
if account:
if len(account.characters) >= settings.MAX_NR_CHARACTERS:
errors.append("There are too many characters associated with this account.")
return obj, errors
# Create the Character
obj = create.create_object(**kwargs)