Skip to content

Commit

Permalink
Simplify publisher_url logic
Browse files Browse the repository at this point in the history
Co-authored-by: Dustin Ingram <[email protected]>
  • Loading branch information
facutuesca and di authored Feb 22, 2024
1 parent 015714a commit 185c044
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions warehouse/oidc/models/gitlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,7 @@ def publisher_name(self):

def publisher_url(self, claims=None):
base = f"https://gitlab.com/{self.project_path}"
sha = claims.get("sha") if claims else None

if sha:
return f"{base}/commit/{sha}"
return base
return f"{base}/commit/{claims['sha']}" if claims else base

def stored_claims(self, claims=None):
claims = claims if claims else {}
Expand Down

0 comments on commit 185c044

Please sign in to comment.