diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c685f8bdc2715c432ff8213afaab6fcba2cea08c..7909394b726669110cc3faf7d6acf7a85cb8f8fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,15 +7,15 @@ variables: POSTGRES_DB: database_name cache: - key: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + key: '$CI_JOB_NAME-$CI_COMMIT_REF_SLUG' paths: - .cache/pip - venv/ before_script: - - python -V + - python -V - python3 -m venv venv - - source venv/bin/activate + - source venv/bin/activate - pip install -r requirements/production.txt stages: @@ -24,14 +24,14 @@ stages: Flake8: stage: Build script: - - flake8 --max-line-length=125 --exclude=src/kszkepzes,migrations,venv + - flake8 --max-line-length=125 --exclude=src/kszkepzes,migrations,venv,env Test: stage: Build variables: - DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB" - SECRET_KEY: "secret" - AUTHSCH_KEY: "secret" - AUTHSCH_SECRET: "secret" + DATABASE_URL: 'postgresql://postgres:postgres@postgres:5432/$POSTGRES_DB' + SECRET_KEY: 'secret' + AUTHSCH_KEY: 'secret' + AUTHSCH_SECRET: 'secret' script: - - python src/manage.py test + - python src/manage.py test diff --git a/src/authsch/authentication.py b/src/authsch/authentication.py index b7e105ad0ce84b42d37440064dd17785425491d9..86d633478edb207219b12f991a41c0398e5d1580 100644 --- a/src/authsch/authentication.py +++ b/src/authsch/authentication.py @@ -21,7 +21,7 @@ class AuthSCHOAuth2(BaseOAuth2): def get_user_details(self, response): """Return user details from AuthSCH account""" return { - 'username': response.get('linkedAccounts').get('schacc'), + 'username': response.get('linkedAccounts').get('schacc'), 'email': response.get('mail'), 'first_name': response.get('givenName'), 'last_name': response.get('sn') diff --git a/src/common/email.py b/src/common/email.py index 838bf7f82e0ee173533cf312f93a9d214a5fcf5b..7273ce6bcdbe40f9a43816e81084f5578cda6479 100644 --- a/src/common/email.py +++ b/src/common/email.py @@ -2,8 +2,6 @@ from django.core.mail import send_mail import codecs import sys - - sender_email = 'noreply@ujonc.kszk.bme.hu' link = 'https://ujonc.kszk.bme.hu/homework' @@ -13,6 +11,7 @@ def read_email(name): data = myfile.read() return data + def send_out_mail(subject, message, sender_email, receiver_email): if 'runserver' in sys.argv: # It is in development