Skip to content

Commit

Permalink
fix: fix bnrach uniqueness for upload case
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-nguyen-cs committed Feb 1, 2024
1 parent 43e6a43 commit 6098b6c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/editor/entries.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,20 @@ async def does_project_exist(self):
else:
return True

async def is_branch_unique(self):
async def is_branch_unique(self, from_github: bool):
"""
Helper function to check uniqueness of GitHub branch
Helper function to check uniqueness of branch
"""
query = """MATCH (n:PROJECT) WHERE n.branch_name = $branch_name RETURN n"""
result = await get_current_transaction().run(query, {"branch_name": self.branch_name})

if not from_github:
return (await result.value()) == []

github_object = GithubOperations(self.taxonomy_name, self.branch_name)
github_branch = await github_object.get_branch(self.branch_name)

if (await result.value() == []) and (github_branch is None):
return True
else:
return False
return (await result.value() == []) and (github_branch is None)

def is_valid_branch_name(self):
"""
Expand Down

0 comments on commit 6098b6c

Please sign in to comment.