Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
refactor: Updated waitlist route
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm committed Dec 4, 2023
1 parent 87f266e commit 9a84d69
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/app/api/api_v1/endpoints/repos.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,15 @@ async def add_repo_to_waitlist(
user=Security(get_current_user, scopes=[UserScope.ADMIN, UserScope.USER]),
) -> None:
telemetry_client.capture(user.id, event="repo-waitlist", properties={"repo_id": repo_id})
# Check if repo exists
repo = await repos.get(repo_id, strict=False)
if repo is None:
gh_repo = gh_client.get_repo(repo_id)
# Notify slack
slack_client.notify(
f"New guideline request for <{gh_repo['html_url']}|{gh_repo['full_name']}> "
f"({gh_repo['stargazers_count']} :star:, {gh_repo['forks']} forks) :pray:",
[],
)
gh_repo = gh_client.get_repo(repo_id)
# Notify slack
slack_client.notify(
f"Request from <https://github.com/{user.login}|{user.login}> :pray:",
[
(
"Repo",
f"<{gh_repo['html_url']}|{gh_repo['full_name']}> "
f"({gh_repo['stargazers_count']} :star:, {gh_repo['forks']} :fork_and_knife:)",
),
],
)

0 comments on commit 9a84d69

Please sign in to comment.