inveniosoftware / inveniosoftware/invenio-github

model: Repository.get filtering uniqueness issues

Open
#54 0 comments 0 reactions 0 assignees View on GitHub
Type: bug
Dominant language
Python
Stars
8
Forks
34
PR merge metrics
No merged PRs in 30d

Description

[This clause in Repository.get](https://github.com/inveniosoftware/invenio-github/blob/master/invenio_github/models.py#L190-L191), might return multiple results (effectively failing because of the `.one()` call). Example:

```python
>>> cls.query.filter((Repository.github_id == 123456) | (Repository.name == 'some/repo')).all()
[,
]
```

The usual cause is that the same user deleted/renamed the old `some/repo`, and created a new one with a new name.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.