mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 06:57:16 +02:00
Resolves issue 138.
This commit is contained in:
parent
e094a4d173
commit
38014eda3c
4 changed files with 33 additions and 21 deletions
|
|
@ -23,11 +23,10 @@ from django.conf import settings
|
|||
from django.contrib.auth.models import User
|
||||
from django.db import IntegrityError
|
||||
|
||||
|
||||
from src.permissions.permissions import set_perm
|
||||
from src.permissions.models import PermissionGroup
|
||||
from src.utils import logger
|
||||
from src.utils.utils import is_iter
|
||||
from src.utils.utils import is_iter, has_parent
|
||||
|
||||
#
|
||||
# Game Object creation
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ def cemit_info(message):
|
|||
"""
|
||||
|
||||
logger.log_infomsg(message)
|
||||
infochan = None
|
||||
try:
|
||||
infochan = settings.CHANNEL_MUDINFO
|
||||
infochan = Channel.objects.get_channel(infochan[0])
|
||||
|
|
|
|||
|
|
@ -432,3 +432,13 @@ def check_evennia_dependencies():
|
|||
if errstring:
|
||||
print "%s\n %s\n%s" % ("-"*78, errstring, '-'*78)
|
||||
return no_error
|
||||
|
||||
def has_parent(basepath, obj):
|
||||
"Checks if basepath is somewhere in objs parent tree."
|
||||
try:
|
||||
return any(cls for cls in obj.__class__.mro()
|
||||
if basepath == "%s.%s" % (cls.__module__, cls.__name__))
|
||||
except (TypeError, AttributeError):
|
||||
# this can occur if we tried to store a class object, not an
|
||||
# instance. Not sure if one should defend against this.
|
||||
return False
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue