Skip to content

Commit

Permalink
s/is_in_draft/is_editing
Browse files Browse the repository at this point in the history
  • Loading branch information
rebkwok committed Jul 16, 2024
1 parent 92caf75 commit e69ed25
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion airlock/business_logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ def is_under_review(self):
BusinessLogicLayer.STATUS_OWNERS[self.status] == RequestStatusOwner.REVIEWER
)

def is_in_draft(self):
def is_editing(self):
return (
BusinessLogicLayer.STATUS_OWNERS[self.status] == RequestStatusOwner.AUTHOR
)
Expand Down
6 changes: 3 additions & 3 deletions airlock/views/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def request_view(request, request_id: str, path: str = ""):
file_withdraw_url = None
code_url = None

if release_request.is_in_draft() and not is_directory_url:
if release_request.is_editing() and not is_directory_url:
# A file can only be withdrawn from a request that is currently
# editable by the author
file_withdraw_url = reverse(
Expand Down Expand Up @@ -124,7 +124,7 @@ def request_view(request, request_id: str, path: str = ""):
# only authors can edit context/controls
and is_author
# and only if the request is in draft i.e. in an author-owned turn
and release_request.is_in_draft()
and release_request.is_editing()
)

can_comment = (
Expand All @@ -139,7 +139,7 @@ def request_view(request, request_id: str, path: str = ""):
# any user with access to the workspace can comment if the request is in draft
(
request.user.can_access_workspace(release_request.workspace)
and release_request.is_in_draft()
and release_request.is_editing()
)
)

Expand Down
2 changes: 1 addition & 1 deletion airlock/views/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def workspace_view(request, workspace_name: str, path: str = ""):
can_action_request = False

multiselect_add = can_action_request and (
workspace.current_request is None or workspace.current_request.is_in_draft()
workspace.current_request is None or workspace.current_request.is_editing()
)

valid_states_to_add = [
Expand Down

0 comments on commit e69ed25

Please sign in to comment.