Security update; Increase rec Django version to 2.2.4
This commit is contained in:
parent
f64a44ce35
commit
781e8310f5
6 changed files with 21 additions and 24 deletions
|
|
@ -152,19 +152,6 @@ class ScriptBase(with_metaclass(TypeclassBase, ScriptDB)):
|
||||||
"""
|
"""
|
||||||
objects = ScriptManager()
|
objects = ScriptManager()
|
||||||
|
|
||||||
def __eq__(self, other):
|
|
||||||
"""
|
|
||||||
Compares two Scripts. Compares dbids.
|
|
||||||
|
|
||||||
Args:
|
|
||||||
other (Script): A script to compare with.
|
|
||||||
|
|
||||||
"""
|
|
||||||
try:
|
|
||||||
return other.dbid == self.dbid
|
|
||||||
except Exception:
|
|
||||||
return False
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "<{cls} {key}>".format(cls=self.__class__.__name__, key=self.key)
|
return "<{cls} {key}>".format(cls=self.__class__.__name__, key=self.key)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ SRESET = chr(19) # shutdown server in reset mode
|
||||||
PYTHON_MIN = '3.7'
|
PYTHON_MIN = '3.7'
|
||||||
TWISTED_MIN = '18.0.0'
|
TWISTED_MIN = '18.0.0'
|
||||||
DJANGO_MIN = '2.1'
|
DJANGO_MIN = '2.1'
|
||||||
DJANGO_REC = '2.1'
|
DJANGO_REC = '2.2.4'
|
||||||
|
|
||||||
try:
|
try:
|
||||||
sys.path[1] = EVENNIA_ROOT
|
sys.path[1] = EVENNIA_ROOT
|
||||||
|
|
@ -397,7 +397,6 @@ ERROR_DJANGO_MIN = \
|
||||||
ERROR: Django {dversion} found. Evennia requires version {django_min}
|
ERROR: Django {dversion} found. Evennia requires version {django_min}
|
||||||
or higher.
|
or higher.
|
||||||
|
|
||||||
TE_TEST
|
|
||||||
If you are using a virtualenv, use the command `pip install --upgrade -e evennia` where
|
If you are using a virtualenv, use the command `pip install --upgrade -e evennia` where
|
||||||
`evennia` is the folder to where you cloned the Evennia library. If not
|
`evennia` is the folder to where you cloned the Evennia library. If not
|
||||||
in a virtualenv you can install django with for example `pip install --upgrade django`
|
in a virtualenv you can install django with for example `pip install --upgrade django`
|
||||||
|
|
@ -409,14 +408,14 @@ ERROR_DJANGO_MIN = \
|
||||||
|
|
||||||
NOTE_DJANGO_MIN = \
|
NOTE_DJANGO_MIN = \
|
||||||
"""
|
"""
|
||||||
NOTE: Django {dversion} found. This will work, but v{django_rec}
|
NOTE: Django {dversion} found. This will work, but Django {django_rec} is
|
||||||
is recommended for production.
|
recommended for production.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
NOTE_DJANGO_NEW = \
|
NOTE_DJANGO_NEW = \
|
||||||
"""
|
"""
|
||||||
NOTE: Django {dversion} found. This is newer than Evennia's
|
NOTE: Django {dversion} found. This is newer than Evennia's
|
||||||
recommended version (v{django_rec}). It might work, but may be new
|
recommended version ({django_rec}). It might work, but may be new
|
||||||
enough to not be fully tested yet. Report any issues.
|
enough to not be fully tested yet. Report any issues.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
@ -1281,7 +1280,7 @@ def check_main_evennia_dependencies():
|
||||||
try:
|
try:
|
||||||
dversion = ".".join(str(num) for num in django.VERSION if isinstance(num, int))
|
dversion = ".".join(str(num) for num in django.VERSION if isinstance(num, int))
|
||||||
# only the main version (1.5, not 1.5.4.0)
|
# only the main version (1.5, not 1.5.4.0)
|
||||||
dversion_main = ".".join(dversion.split(".")[:2])
|
dversion_main = ".".join(dversion.split(".")[:3])
|
||||||
if LooseVersion(dversion) < LooseVersion(DJANGO_MIN):
|
if LooseVersion(dversion) < LooseVersion(DJANGO_MIN):
|
||||||
print(ERROR_DJANGO_MIN.format(
|
print(ERROR_DJANGO_MIN.format(
|
||||||
dversion=dversion_main, django_min=DJANGO_MIN))
|
dversion=dversion_main, django_min=DJANGO_MIN))
|
||||||
|
|
|
||||||
|
|
@ -358,6 +358,10 @@ class TypedObject(SharedMemoryModel):
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
# this is required to maintain hashing
|
||||||
|
return super().__hash__()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return smart_str("%s" % self.db_key)
|
return smart_str("%s" % self.db_key)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -173,14 +173,14 @@ class SharedMemoryModelBase(ModelBase):
|
||||||
_GA(cls, "save")(update_fields=update_fields)
|
_GA(cls, "save")(update_fields=update_fields)
|
||||||
|
|
||||||
# wrapper factories
|
# wrapper factories
|
||||||
def fget(cls): return _get(cls, fieldname)
|
|
||||||
if not editable:
|
if not editable:
|
||||||
|
def fget(cls): return _get(cls, fieldname)
|
||||||
def fset(cls, val): return _set_nonedit(cls, fieldname, val)
|
def fset(cls, val): return _set_nonedit(cls, fieldname, val)
|
||||||
elif foreignkey:
|
elif foreignkey:
|
||||||
def fget(cls): return _get_foreign(cls, fieldname)
|
def fget(cls): return _get_foreign(cls, fieldname)
|
||||||
|
|
||||||
def fset(cls, val): return _set_foreign(cls, fieldname, val)
|
def fset(cls, val): return _set_foreign(cls, fieldname, val)
|
||||||
else:
|
else:
|
||||||
|
def fget(cls): return _get(cls, fieldname)
|
||||||
def fset(cls, val): return _set(cls, fieldname, val)
|
def fset(cls, val): return _set(cls, fieldname, val)
|
||||||
|
|
||||||
def fdel(cls): return _del(cls, fieldname) if editable else _del_nonedit(cls, fieldname)
|
def fdel(cls): return _del(cls, fieldname) if editable else _del_nonedit(cls, fieldname)
|
||||||
|
|
@ -336,6 +336,13 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
||||||
|
|
||||||
# per-instance methods
|
# per-instance methods
|
||||||
|
|
||||||
|
def __eq__(self, other):
|
||||||
|
return super().__eq__(other)
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
# this is required to maintain hashing
|
||||||
|
return super().__hash__()
|
||||||
|
|
||||||
def at_idmapper_flush(self):
|
def at_idmapper_flush(self):
|
||||||
"""
|
"""
|
||||||
This is called when the idmapper cache is flushed and
|
This is called when the idmapper cache is flushed and
|
||||||
|
|
@ -395,7 +402,7 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
||||||
try:
|
try:
|
||||||
super().save(*args, **kwargs)
|
super().save(*args, **kwargs)
|
||||||
except DatabaseError:
|
except DatabaseError:
|
||||||
# we handle the 'update_fields did not update any rows' error that
|
# we handle the 'update_fields did not update any rows' error that
|
||||||
# may happen due to timing issues with attributes
|
# may happen due to timing issues with attributes
|
||||||
ufields_removed = kwargs.pop('update_fields', None)
|
ufields_removed = kwargs.pop('update_fields', None)
|
||||||
if ufields_removed:
|
if ufields_removed:
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Evennia dependencies, for Linux/Mac platforms
|
# Evennia dependencies, for Linux/Mac platforms
|
||||||
|
|
||||||
# general
|
# general
|
||||||
django >= 2.1, < 2.2
|
django >= 2.2.4, < 2.3
|
||||||
twisted >= 19.2.1, < 20.0.0
|
twisted >= 19.2.1, < 20.0.0
|
||||||
pillow == 5.2.0
|
pillow == 5.2.0
|
||||||
pytz
|
pytz
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
pypiwin32
|
pypiwin32
|
||||||
|
|
||||||
# general
|
# general
|
||||||
django >= 2.1, < 2.2
|
django >= 2.2.4, < 2.3
|
||||||
twisted >= 19.2.1, < 20.0.0
|
twisted >= 19.2.1, < 20.0.0
|
||||||
pillow == 5.2.0
|
pillow == 5.2.0
|
||||||
pytz
|
pytz
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue