Skip to content

Commit

Permalink
Move the lvmweb URL Slack message after the error message
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 9, 2024
1 parent d6bd951 commit 7d9f60f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lvmcryo/notifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,6 @@ async def notify_after_fill(
new_line = pattern.sub(r"\1\2", line)
log_lines.append(new_line)

lvmweb_url: str | None = None
if record_pk is not None:
lvmweb_url = self.config.lvmweb_fill_url.format(fill_id=record_pk)
await self.post_to_slack(
"Information about the fill can be found at "
f"<{lvmweb_url}|this link>."
)

if post_to_slack:
try:
if success:
Expand All @@ -318,6 +310,14 @@ async def notify_after_fill(
except Exception as err:
log.error(f"Failed posting to Slack: {err!r}")

lvmweb_url: str | None = None
if record_pk is not None:
lvmweb_url = self.config.lvmweb_fill_url.format(fill_id=record_pk)
await self.post_to_slack(
"Information about the fill can be found at "
f"<{lvmweb_url}|this link>."
)

if send_email:
subject: str = (
"SUCCESS: LVM LN2 fill completed"
Expand Down

0 comments on commit 7d9f60f

Please sign in to comment.