Skip to content

Commit 0f65411

Browse files
authored
Core: Avoids a potential race condition for messages tied to a session
TYPE: Bugfix LINK: ONEGOV-CLOUD-5DM
1 parent 7650a01 commit 0f65411

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

do/changes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,7 @@ class ChangelogCommit:
158158

159159
if link.startswith('ONEGOV-CLOUD-'):
160160
return (
161-
f'https://sentry.io/organizations/seantis-gmbh'
162-
f'/issues/?query={link}'
161+
f'https://seantis-gmbh.sentry.io/issues/?query={link}'
163162
)
164163

165164
if link.startswith('STAKA-'):

src/onegov/core/request.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -621,15 +621,10 @@ def message(self, text: str, type: MessageType) -> None:
621621
template using the messages should call :meth:`consume_messages`.
622622
623623
"""
624-
if not self.browser_session.has('messages'):
625-
self.browser_session.messages = [Message(text, type)]
626-
else:
627-
# this is a bit akward, but I don't see an easy way for this atm.
628-
# (otoh, usually there's going to be one message only)
629-
self.browser_session.messages = [
630-
*self.browser_session.messages,
631-
Message(text, type)
632-
]
624+
self.browser_session.messages = [
625+
*self.browser_session.get('messages', ()),
626+
Message(text, type)
627+
]
633628

634629
def consume_messages(self) -> Iterator[Message]:
635630
""" Returns the messages, removing them from the session in the

0 commit comments

Comments
 (0)