Skip to content

Commit dd0ec07

Browse files
authored
Fix CI (#544)
* Re-encrypt file * Fix tests * Fix pyup safety
1 parent 59d3d1f commit dd0ec07

File tree

6 files changed

+17
-16
lines changed

6 files changed

+17
-16
lines changed

.github.env.gpg

3 Bytes
Binary file not shown.

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ default: build
66
@gpg --decrypt --batch --passphrase "$(GPG_PASSPHRASE)" .github.env.gpg >.github.env
77

88
github-env: .github.env
9-
@echo "SUFFIX=$(shell cat /proc/sys/kernel/random/uuid)" >"$(GITHUB_ENV)"
10-
@sed 's/^export //' <.github.env >"$(GITHUB_ENV)"
9+
@docker run --rm python:3.7 python -c 'import uuid; print("SUFFIX=%s" % uuid.uuid4())' >>"$(GITHUB_ENV)"
10+
@sed 's/^export //' <.github.env >>"$(GITHUB_ENV)"
1111

1212
integration-tests:
1313
docker-compose -f docker-compose.yml -f docker/docker-compose.test.yml build integtest && \

opwen_email_client/webapp/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class AppConfig(object):
6767
SQLALCHEMY_MIGRATE_REPO = path.join(STATE_BASEDIR, 'app.migrate')
6868
SQLALCHEMY_TRACK_MODIFICATIONS = False
6969

70-
SECRET_KEY = env('OPWEN_SESSION_KEY', None)
70+
SECRET_KEY = env('OPWEN_SESSION_KEY', 'NoSecret')
7171

7272
CELERY_SQLITE_PATH = path.join(STATE_BASEDIR, 'celery.sqlite3')
7373
CELERY_BROKER_URL = env('CELERY_BROKER_URL', 'sqlalchemy+sqlite:///' + CELERY_SQLITE_PATH)

opwen_email_server/services/sendgrid.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,18 @@ def _create_email(self, email: dict, email_id: str) -> Mail:
107107
# so that the email still gets routed back to the original client
108108
# ...this is a pretty ugly hack and the real fix is to change the logic of
109109
# how we sign up users on clients to use the new format {user}-{client}@{domain}
110-
from_email = email['from']
111-
user, client_domain = from_email.split('@')
112-
client_domain_parts = client_domain.split('.')
113-
if len(client_domain_parts) == 3:
114-
client = client_domain_parts[0]
115-
domain = '.'.join(client_domain_parts[1:])
116-
mail.from_email = Email('{}-{}@{}'.format(user, client, domain))
117-
mail.reply_to = Email(from_email)
118-
else:
119-
mail.from_email = Email(from_email)
120-
self.log_debug('added from to email %s', email_id)
110+
from_email = email.get('from')
111+
if from_email:
112+
user, client_domain = from_email.split('@')
113+
client_domain_parts = client_domain.split('.')
114+
if len(client_domain_parts) == 3:
115+
client = client_domain_parts[0]
116+
domain = '.'.join(client_domain_parts[1:])
117+
mail.from_email = Email('{}-{}@{}'.format(user, client, domain))
118+
mail.reply_to = Email(from_email)
119+
else:
120+
mail.from_email = Email(from_email)
121+
self.log_debug('added from to email %s', email_id)
121122

122123
for i, attachment in enumerate(email.get('attachments', [])):
123124
mail.add_attachment(self._create_attachment(attachment))

requirements-webapp.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ typing==3.7.4.3
2828
tzlocal==2.1
2929
watchdog==0.10.4
3030
xtarfile[zstd]==0.0.4
31-
Pillow==8.1.1
31+
Pillow==8.1.2

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Flask==1.1.2
22
Flask-Cors==3.0.9
3-
Pillow==8.1.1
3+
Pillow==8.1.2
44
apache-libcloud==3.2.0
55
applicationinsights==0.11.9
66
beautifulsoup4==4.9.3

0 commit comments

Comments
 (0)