From 7ffddf41f86b1768c344732c8720124eb2360135 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Wed, 9 Oct 2019 23:23:16 +0300 Subject: [PATCH] Fix some paths --- kaehmy/views.py | 9 +++++---- ohlhafv/views.py | 3 ++- package.json | 4 ++-- sikweb/settings-sample-prod.py | 1 + sikweb/settings-sample.py | 1 + 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/kaehmy/views.py b/kaehmy/views.py index ff4cf3c..eb0f22c 100644 --- a/kaehmy/views.py +++ b/kaehmy/views.py @@ -11,6 +11,7 @@ from django.core.mail import send_mail import logging import requests from dealer.git import git +from sikweb.settings import URL from members.views.utils import * from kaehmy.models import Application, CustomRole, PresetRole, TelegramChannel @@ -60,12 +61,12 @@ def comment(request, *args, **kwargs): name = comment.name subject = 'Kaehmyysi tai kommenttiisi on vastattu!' - body = ('{} on vastannut kaehmyhakemukseesi tai kommenttiisi kaehmypalvelussa.\r\n\r\n' - 'Käy lukemassa viesti osoitteessa http://sika.sahkoinsinoorikilta.fi/kaehmy').format(name.capitalize()) + body = (f'{name.capitalize()} on vastannut kaehmyhakemukseesi tai kommenttiisi kaehmypalvelussa.\r\n\r\n' + 'Käy lukemassa viesti osoitteessa https://{URL}/kaehmy') send_email(email, subject, body) logging.debug( - 'Sent kaehmy comment email to recipient <{}>'.format(email)) + f'Sent kaehmy comment email to recipient <{email}>') return redirect('/kaehmy') else: @@ -123,7 +124,7 @@ def submit(request, *args, **kwargs): custom_role.save() application.custom_roles.add(custom_role) - url = 'https://sika.sahkoinsinoorikilta.fi/kaehmy' + url = f'https://{URL}/kaehmy' email = form.cleaned_data.get('email', '') name = form.cleaned_data.get('name', 'Anonymous') diff --git a/ohlhafv/views.py b/ohlhafv/views.py index 632ab4e..0def955 100644 --- a/ohlhafv/views.py +++ b/ohlhafv/views.py @@ -14,6 +14,7 @@ from django.template.loader import render_to_string import logging import requests from dealer.git import git +from sikweb.settings import URL from ohlhafv.models import OhlhafvChallenge from ohlhafv.forms import OhlhafvForm @@ -39,7 +40,7 @@ def ohlhafv_submit(request, *args, **kwargs): challenge = form.instance email = form.cleaned_data.get('victim_email', '') - url = 'https://sika.sahkoinsinoorikilta.fi/ohlhafv/list' + url = f'https://{URL}/ohlhafv/list' subject = _('Sinut on haastettu Øhlhäfviin!') message = render_to_string( diff --git a/package.json b/package.json index 2862399..ddb3578 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git@sika.sahkoinsinoorikilta.fi:vtmk/web2.0.git" + "url": "git@gitlab.com:sahkoinsinoorikilta/vtmk/web2.0-backend.git" }, "author": "SIK ry", "license": "ISC", @@ -23,4 +23,4 @@ "remark-preset-lint-recommended" ] } -} +} \ No newline at end of file diff --git a/sikweb/settings-sample-prod.py b/sikweb/settings-sample-prod.py index 9715b86..bb05654 100644 --- a/sikweb/settings-sample-prod.py +++ b/sikweb/settings-sample-prod.py @@ -17,6 +17,7 @@ from sikweb.base import * DEBUG = False ALLOWED_HOSTS = ["sika.sik.party"] +URL = "sika.sik.party" # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.getenv('SECRET_KEY', '') diff --git a/sikweb/settings-sample.py b/sikweb/settings-sample.py index 5789c22..b92133c 100644 --- a/sikweb/settings-sample.py +++ b/sikweb/settings-sample.py @@ -17,6 +17,7 @@ from sikweb.base import * DEBUG = True # ALLOWED_HOSTS = ["*"] +URL = "sika.sik.party" # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = '7p$85^4ibb^p4-=vs44b7!y0e-zemugze18@a#30&71=a8)dp('