remove unnecessary officer properties on workspace

This commit is contained in:
dandds 2019-01-04 13:30:41 -05:00
parent 356a0fab2c
commit 65a88da63b
2 changed files with 1 additions and 19 deletions

View File

@ -63,21 +63,3 @@ class Workspace(Base, mixins.TimestampsMixin, mixins.AuditableMixin):
return "<Workspace(name='{}', request='{}', user_count='{}', id='{}')>".format(
self.name, self.request_id, self.user_count, self.id
)
def _find_by_role(self, role):
try:
return [member for member in self.members if member.role.name == role]
except StopIteration:
return None
@property
def contracting_officer(self):
return self._find_by_role("contracting_officer")
@property
def contracting_officer_representative(self):
return self._find_by_role("contracting_officer_representative")
@property
def security_officer(self):
return self._find_by_role("security_officer")

View File

@ -161,7 +161,7 @@ class UpdateTaskOrderWorkflow(ShowTaskOrderWorkflow):
if (
hasattr(self.form, field)
and self.form[field].data
and not getattr(self.workspace, officer_type["role"])
and not getattr(self.task_order, officer_type["role"])
):
prefix = officer_type["prefix"]
officer_data = {