Attribute names are no longer case-sensitive, as per MUX/MUSH. Also added LAST and LASTSITE to the protected attribute list.

This commit is contained in:
Greg Taylor 2007-05-18 13:39:57 +00:00
parent 2a46879ad2
commit 9221f889e3
2 changed files with 3 additions and 3 deletions

View file

@ -338,7 +338,7 @@ class Object(models.Model):
"""
if self.has_attribute(attribute):
# Attribute already exists, update it.
attrib_obj = Attribute.objects.filter(object=self).filter(name=attribute)[0]
attrib_obj = Attribute.objects.filter(object=self).filter(name__iexact=attribute)[0]
attrib_obj.value = new_value
attrib_obj.save()
else:
@ -355,7 +355,7 @@ class Object(models.Model):
attribute: (str) The attribute's name.
"""
attr = Attribute.objects.filter(object=self).filter(name=attribute)
attr = Attribute.objects.filter(object=self).filter(name__iexact=attribute)
if attr.count() == 0:
return False
else:

View file

@ -30,7 +30,7 @@ NOSAVE_FLAGS = ["CONNECTED"]
NOSET_FLAGS = ["CONNECTED"]
# These attribute names can't be modified by players.
NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "CHANLIST"]
NOSET_ATTRIBS = ["MONEY", "ALIAS", "LASTPAGED", "CHANLIST", "LAST", "LASTSITE"]
# Server version number.
EVENNIA_VERSION = 'Pre-Alpha'