Skip to content

Commit fe3de9b

Browse files
committed
Fix: bug in github username for reviewers)
1 parent 7777a5f commit fe3de9b

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
[![PyPI](https://img.shields.io/pypi/v/pyosmeta.svg)](https://pypi.org/project/pyosmeta/)
44

55
## [Unreleased]
6+
- Fix: bug where if a github username has a name after it returns a invalid cleaned github username (@lwasser)
67

78
## [v0.2.4] - 2024-03-29
89

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This repo contains a small module and several CLI scripts, including:
1818

1919
_Since pyOpenSci uses this tool for its website, we expect this package to have infrequent releases._
2020

21+
2122
## Installation
2223

2324
Using pip:

src/pyosmeta/cli/update_review_teams.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
def get_clean_user(username: str) -> str:
3636
"""A small helper that removes whitespace and ensures username is
3737
lower case"""
38+
# If the github username has spaces there is an error which might be
39+
# that someone added a name after the username. Only return the github
40+
# username
41+
if len(username.split()) > 1:
42+
username = username.split()[0]
3843
return username.lower().strip()
3944

4045

@@ -61,7 +66,9 @@ def main():
6166

6267
if gh_user not in contribs.keys():
6368
print("Found a new contributor!", gh_user)
64-
new_contrib = process_contribs.get_user_info(gh_user)
69+
new_contrib = process_contribs.return_user_info(
70+
gh_user
71+
)
6572
new_contrib["date_added"] = datetime.now().strftime(
6673
"%Y-%m-%d"
6774
)

0 commit comments

Comments
 (0)