Fix Task.archived_tag read-only property does not work (issue #274)

This commit is contained in:
allegroai 2021-01-10 12:49:06 +02:00
parent 504dfd8f32
commit c28f8cf65b
3 changed files with 3 additions and 7 deletions

View File

@ -27,7 +27,6 @@ from collections import OrderedDict
from six.moves.urllib.parse import quote from six.moves.urllib.parse import quote
from ...utilities.locks import RLock as FileRLock from ...utilities.locks import RLock as FileRLock
from ...utilities.attrs import readonly
from ...utilities.proxy_object import verify_basic_type from ...utilities.proxy_object import verify_basic_type
from ...binding.artifacts import Artifacts from ...binding.artifacts import Artifacts
from ...backend_interface.task.development.worker import DevWorker from ...backend_interface.task.development.worker import DevWorker
@ -63,7 +62,7 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin):
_anonymous_dataview_id = '__anonymous__' _anonymous_dataview_id = '__anonymous__'
_development_tag = 'development' _development_tag = 'development'
archived_tag = readonly('archived') archived_tag = 'archived'
_default_configuration_section_name = 'General' _default_configuration_section_name = 'General'
_legacy_parameters_section_name = 'Args' _legacy_parameters_section_name = 'Args'
_force_requirements = {} _force_requirements = {}

View File

@ -3076,7 +3076,8 @@ class Task(_Task):
) )
) )
res_tasks = res.response.tasks res_tasks = res.response.tasks
# if we have more than one result, first filter 'archived' results: # if we have more than one result, filter out the 'archived' results
# notice that if we only have one result we do get the archived one as well.
if len(res_tasks) > 1: if len(res_tasks) > 1:
filtered_tasks = [t for t in res_tasks if not getattr(t, system_tags, None) or filtered_tasks = [t for t in res_tasks if not getattr(t, system_tags, None) or
cls.archived_tag not in getattr(t, system_tags, None)] cls.archived_tag not in getattr(t, system_tags, None)]

View File

@ -16,7 +16,3 @@ class attrs(object):
def __call__(self, f): def __call__(self, f):
return attr.attrs(*self.args, **self.kwargs)(f) return attr.attrs(*self.args, **self.kwargs)(f)
def readonly(value):
return property(lambda self: value)