Skip to content

Commit

Permalink
Return instead of raise ValueError (#2290)
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Nov 14, 2021
1 parent b0732b1 commit e651a06
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion custom_components/hacs/hacsbase/hacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def async_set_repository_id(self, repository, repo_id):
def async_add_repository(self, repository):
"""Add a repository to the list."""
if repository.data.full_name_lower in self._repositories_by_full_name:
raise ValueError(f"The repo {repository.data.full_name_lower} is already added")
return
self._repositories.append(repository)
repo_id = str(repository.data.id)
if repo_id != "0":
Expand Down
3 changes: 0 additions & 3 deletions tests/hacsbase/test_hacs.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ async def test_add_remove_repository(hacs, repository, tmpdir):
repository.data.id = "0"
hacs.async_add_repository(repository)

with pytest.raises(ValueError):
hacs.async_add_repository(repository)

hacs.async_set_repository_id(repository, "42")

# Once its set, it should never change
Expand Down

0 comments on commit e651a06

Please sign in to comment.