Skip to content

Commit

Permalink
Infra: Use simpler check for title in Discourse URL header processing
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed Apr 15, 2022
1 parent 1b65290 commit 7ff9c3a
Showing 1 changed file with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,7 @@ def _process_discourse_url(parts: list[str]) -> tuple[str, str]:
f"{'/'.join(parts)} not a link to a Discourse thread or category")

first_subpart = parts[4]
try:
int(first_subpart)
except ValueError:
has_title = True
else:
has_title = False
has_title = not first_subpart.isnumeric()

if "t" in parts:
item_type = "post" if len(parts) > (5 + has_title) else "thread"
Expand Down

0 comments on commit 7ff9c3a

Please sign in to comment.