Commit 1b050900 by Őry Máté

one: remove hardcoded email address

parent 4a98d32a
...@@ -259,7 +259,8 @@ FIREWALL_SETTINGS = { ...@@ -259,7 +259,8 @@ FIREWALL_SETTINGS = {
"dns_ip": "152.66.243.60", "dns_ip": "152.66.243.60",
"dns_ttl": "300", "dns_ttl": "300",
} }
SITE_NAME = "IK Cloud"
DEFAULT_FROM_EMAIL = "noreply@cloud.ik.bme.hu"
EMAIL_HOST='152.66.243.92' # giccero ipv4 EMAIL_HOST='152.66.243.92' # giccero ipv4
CLOUD_URL='https://cloud.ik.bme.hu/' CLOUD_URL='https://cloud.ik.bme.hu/'
RELEASE = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD']) RELEASE = subprocess.check_output(['git', 'rev-parse', '--symbolic-full-name', '--abbrev-ref', 'HEAD'])
......
from celery.task import Task, PeriodicTask from celery.task import Task
import logging import logging
import celery
import os
import sys
import time
from django.core.mail import send_mail from django.core.mail import send_mail
from django.conf import settings
from one.models import Instance from one.models import Instance
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class SendMailTask(Task): class SendMailTask(Task):
def run(self, to, subject, msg, sender=u'noreply@cloud.ik.bme.hu'): def run(self, to, subject, msg, sender=None):
send_mail(subject, msg, sender, [ to ], fail_silently=False) if sender is None:
logger.info("[django][one][tasks.py] %s->%s [%s]" % (sender, to, subject) ) if settings.SITE_NAME:
sender = '"%s" <%s>' % (settings.SITE_NAME.replace('"', ''),
settings.DEFAULT_FROM_EMAIL)
else:
sender = settings.DEFAULT_FROM_EMAIL
send_mail(subject, msg, sender, [to, ], fail_silently=False)
logger.info("[django][one][tasks] %s->%s %s" % (sender, to, subject))
class UpdateInstanceStateTask(Task): class UpdateInstanceStateTask(Task):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment