mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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()
|
||||
|
||||
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):
|
||||
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'
|
||||
TWISTED_MIN = '18.0.0'
|
||||
DJANGO_MIN = '2.1'
|
||||
DJANGO_REC = '2.1'
|
||||
DJANGO_REC = '2.2.4'
|
||||
|
||||
try:
|
||||
sys.path[1] = EVENNIA_ROOT
|
||||
|
|
@ -397,7 +397,6 @@ ERROR_DJANGO_MIN = \
|
|||
ERROR: Django {dversion} found. Evennia requires version {django_min}
|
||||
or higher.
|
||||
|
||||
TE_TEST
|
||||
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
|
||||
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 {dversion} found. This will work, but v{django_rec}
|
||||
is recommended for production.
|
||||
NOTE: Django {dversion} found. This will work, but Django {django_rec} is
|
||||
recommended for production.
|
||||
"""
|
||||
|
||||
NOTE_DJANGO_NEW = \
|
||||
"""
|
||||
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.
|
||||
"""
|
||||
|
||||
|
|
@ -1281,7 +1280,7 @@ def check_main_evennia_dependencies():
|
|||
try:
|
||||
dversion = ".".join(str(num) for num in django.VERSION if isinstance(num, int))
|
||||
# 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):
|
||||
print(ERROR_DJANGO_MIN.format(
|
||||
dversion=dversion_main, django_min=DJANGO_MIN))
|
||||
|
|
|
|||
|
|
@ -358,6 +358,10 @@ class TypedObject(SharedMemoryModel):
|
|||
except AttributeError:
|
||||
return False
|
||||
|
||||
def __hash__(self):
|
||||
# this is required to maintain hashing
|
||||
return super().__hash__()
|
||||
|
||||
def __str__(self):
|
||||
return smart_str("%s" % self.db_key)
|
||||
|
||||
|
|
|
|||
|
|
@ -173,14 +173,14 @@ class SharedMemoryModelBase(ModelBase):
|
|||
_GA(cls, "save")(update_fields=update_fields)
|
||||
|
||||
# wrapper factories
|
||||
def fget(cls): return _get(cls, fieldname)
|
||||
if not editable:
|
||||
def fget(cls): return _get(cls, fieldname)
|
||||
def fset(cls, val): return _set_nonedit(cls, fieldname, val)
|
||||
elif foreignkey:
|
||||
def fget(cls): return _get_foreign(cls, fieldname)
|
||||
|
||||
def fset(cls, val): return _set_foreign(cls, fieldname, val)
|
||||
else:
|
||||
def fget(cls): return _get(cls, fieldname)
|
||||
def fset(cls, val): return _set(cls, fieldname, val)
|
||||
|
||||
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
|
||||
|
||||
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):
|
||||
"""
|
||||
This is called when the idmapper cache is flushed and
|
||||
|
|
@ -395,7 +402,7 @@ class SharedMemoryModel(with_metaclass(SharedMemoryModelBase, Model)):
|
|||
try:
|
||||
super().save(*args, **kwargs)
|
||||
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
|
||||
ufields_removed = kwargs.pop('update_fields', None)
|
||||
if ufields_removed:
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Evennia dependencies, for Linux/Mac platforms
|
||||
|
||||
# general
|
||||
django >= 2.1, < 2.2
|
||||
django >= 2.2.4, < 2.3
|
||||
twisted >= 19.2.1, < 20.0.0
|
||||
pillow == 5.2.0
|
||||
pytz
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
pypiwin32
|
||||
|
||||
# general
|
||||
django >= 2.1, < 2.2
|
||||
django >= 2.2.4, < 2.3
|
||||
twisted >= 19.2.1, < 20.0.0
|
||||
pillow == 5.2.0
|
||||
pytz
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue