From 258740e490aa44df1cefd372afd8d4b474bea955 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 20 Jun 2025 18:07:43 +0200 Subject: [PATCH 1/2] temp fix email --- .#config.yaml | 1 - rowers/emails.py | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) delete mode 120000 .#config.yaml diff --git a/.#config.yaml b/.#config.yaml deleted file mode 120000 index b90ba2a6..00000000 --- a/.#config.yaml +++ /dev/null @@ -1 +0,0 @@ -sander@rowsandall-2.14384:1749892836 \ No newline at end of file diff --git a/rowers/emails.py b/rowers/emails.py index 424540dc..0977fc33 100644 --- a/rowers/emails.py +++ b/rowers/emails.py @@ -136,7 +136,10 @@ def send_template_email(from_email, to_email, subject, if not emailbounced: - res = msg.send() + try: + res = msg.send() + except: + return 0 else: # pragma: no cover return 0 From 2722955f138328a1072b8566b43318bb092bedc6 Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Fri, 20 Jun 2025 19:38:54 +0200 Subject: [PATCH 2/2] fix --- rowers/emails.py | 2 +- rowers/integrations/nk.py | 2 +- rowers/tests/mocks.py | 3 +++ rowers/tests/testdata/testdata.tcx.gz | Bin 3989 -> 3989 bytes 4 files changed, 5 insertions(+), 2 deletions(-) diff --git a/rowers/emails.py b/rowers/emails.py index 0977fc33..d79b3a70 100644 --- a/rowers/emails.py +++ b/rowers/emails.py @@ -139,7 +139,7 @@ def send_template_email(from_email, to_email, subject, try: res = msg.send() except: - return 0 + return 1 else: # pragma: no cover return 0 diff --git a/rowers/integrations/nk.py b/rowers/integrations/nk.py index a26a7cc9..e6694482 100644 --- a/rowers/integrations/nk.py +++ b/rowers/integrations/nk.py @@ -139,7 +139,7 @@ class NKIntegration(SyncIntegration): after = temp r = self.rower - authorizationstring = str('Bearer ' + r.nktoken) + authorizationstring = "Bearer {token}".format(token = r.nktoken) headers = {'Authorization': authorizationstring, 'user-agent': 'sanderroosendaal', 'Content-Type': 'application/json', diff --git a/rowers/tests/mocks.py b/rowers/tests/mocks.py index d969b8ef..0db2ae33 100644 --- a/rowers/tests/mocks.py +++ b/rowers/tests/mocks.py @@ -137,6 +137,7 @@ def mocked_session(*args, **kwargs): 'Location':'MockLocation', } self.ok = True + self.text = 'Mocked response text' def json(self): return self.json_data @@ -991,6 +992,7 @@ def mocked_requests(*args, **kwargs): self.headers = { 'Location':'MockLocation', } + self.text = 'Mocked response text' def json(self): return self.json_data @@ -1574,6 +1576,7 @@ class MockResponse: # pragma: no cover self.headers = { 'Location':'MockLocation', } + self.text = 'Mocked response text' def json(self): return self.json_data diff --git a/rowers/tests/testdata/testdata.tcx.gz b/rowers/tests/testdata/testdata.tcx.gz index 8be32d41843def2351fa629ff0930631e6d0623f..1d07dcefdafdaa6b0dffef9c3fda959fea19ce61 100644 GIT binary patch delta 16 XcmbO#KUJPxzMF$%$(+!Q?0x(IDp~~; delta 16 XcmbO#KUJPxzMF$%*RtS^?0x(ID<%ap