Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ajermaky committed May 1, 2024
1 parent 0c1aa2c commit 11c6564
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/py/reddit_edgecontext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@ class Service(NamedTuple):

def is_service(self) -> bool:
subject = self.authentication_token.subject
return subject and subject.startswith("service/")
if subject is None or subject == "":
return False
return subject.startswith("service/")

@property
def name(self) -> str:
Expand All @@ -434,9 +436,9 @@ def name(self) -> str:
service.
"""
if not self.is_service():
raise NoAuthenticationError
subject = self.authentication_token.subject
if subject is None or subject == "":
raise NoAuthenticationError
name = subject[len("service/") :]
return name

Expand Down

0 comments on commit 11c6564

Please sign in to comment.