Merge remote-tracking branch 'origin/v3.0'

This commit is contained in:
Adolfo Gómez García 2021-03-11 14:15:01 +01:00
commit c90f9c40fd
2 changed files with 3 additions and 7 deletions

View File

@ -146,7 +146,7 @@ class Environment:
It will not make environment persistent
"""
env = Environment(TEMP_ENV)
env.storage.delete()
env.storage.delete(TEMP_ENV)
env.cache.clean()
return Environment(TEMP_ENV)

View File

@ -390,9 +390,5 @@ class Storage:
yield (v[0], pickle.loads(v[1]), v[2])
@staticmethod
def delete(owner: typing.Optional[str] = None) -> None:
if owner is None:
objects = DBStorage.objects.all() # @UndefinedVariable
else:
objects = DBStorage.objects.filter(owner=owner) # @UndefinedVariable
objects.delete()
def delete(owner: str) -> None:
DBStorage.objects.filter(owner=owner).delete()