From 7a97f1e9c362aeda6c3749855c222bd131efd131 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Mon, 30 Dec 2024 10:43:29 +0000 Subject: [PATCH] bluesky: remove url length override this was either changed or was never true before. not sure what i did there. --- voctopublish/api_client/bluesky_client.py | 2 +- voctopublish/tools/announcements.py | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/voctopublish/api_client/bluesky_client.py b/voctopublish/api_client/bluesky_client.py index 310fbe7..2a45526 100644 --- a/voctopublish/api_client/bluesky_client.py +++ b/voctopublish/api_client/bluesky_client.py @@ -29,7 +29,7 @@ def send_post(ticket, config): LOG.info("post the release to bluesky") try: - message = make_message(ticket, config, 280, 24) + message = make_message(ticket, config, 280) except EmptyAnnouncementMessage: return diff --git a/voctopublish/tools/announcements.py b/voctopublish/tools/announcements.py index 90c0fa0..9cb8ee0 100644 --- a/voctopublish/tools/announcements.py +++ b/voctopublish/tools/announcements.py @@ -25,7 +25,7 @@ def _replace_special_chars(maybe_string): return sub(r"[^A-Za-z0-9]+", "", string) -def make_message(ticket, config, max_length=None, override_url_length=None): +def make_message(ticket, config, max_length=None): if max_length is None: # if max_length is not set, set it to something very big here. # saves us a bunch of isinstance() calls below @@ -71,12 +71,7 @@ def make_message(ticket, config, max_length=None, override_url_length=None): message += " #" + tag for url in urls: - if override_url_length: - url_len = override_url_length - else: - url_len = len(url) - - if url_len <= (max_length - len(message)): + if len(url) <= (max_length - len(message)): message = message + " " + url LOG.info(f"{len(message)} chars: {message}")