fix conflict
This commit is contained in:
@@ -9,7 +9,8 @@ from django.core.mail import EmailMultiAlternatives
|
|||||||
from django.utils.html import format_html
|
from django.utils.html import format_html
|
||||||
from backend.core.utils import generate_first_page_image
|
from backend.core.utils import generate_first_page_image
|
||||||
from email.mime.image import MIMEImage
|
from email.mime.image import MIMEImage
|
||||||
|
from django.conf import settings
|
||||||
|
site_domain = settings.SITE_DOMAIN
|
||||||
|
|
||||||
def send_confirmation_email(email):
|
def send_confirmation_email(email):
|
||||||
confirmation, created = EmailConfirmation.objects.get_or_create(email=email)
|
confirmation, created = EmailConfirmation.objects.get_or_create(email=email)
|
||||||
@@ -19,7 +20,7 @@ def send_confirmation_email(email):
|
|||||||
confirmation.created_at = now()
|
confirmation.created_at = now()
|
||||||
confirmation.save()
|
confirmation.save()
|
||||||
|
|
||||||
confirmation_link = f"http://127.0.0.1:8000{reverse('confirm_email', args=[confirmation.uuid])}"
|
confirmation_link = f"{site_domain}{reverse('confirm_email', args=[confirmation.uuid])}"
|
||||||
|
|
||||||
send_mail(
|
send_mail(
|
||||||
subject="Confirm your e-mail address",
|
subject="Confirm your e-mail address",
|
||||||
@@ -32,7 +33,7 @@ def send_payment_email(email):
|
|||||||
organization = Organization.objects.get(email=email)
|
organization = Organization.objects.get(email=email)
|
||||||
document = Document.objects.get(organization=organization)
|
document = Document.objects.get(organization=organization)
|
||||||
|
|
||||||
payment_link = f"http://127.0.0.1:8000{reverse('core:payment_page')}?email={email}"
|
payment_link = f"{site_domain}{reverse('core:payment_page')}?email={email}"
|
||||||
|
|
||||||
send_mail(
|
send_mail(
|
||||||
subject="Complete your payment",
|
subject="Complete your payment",
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ class CreatedBy(models.Model):
|
|||||||
|
|
||||||
|
|
||||||
class Organization(models.Model):
|
class Organization(models.Model):
|
||||||
name = models.CharField(max_length=255, help_text="What is the name of your organization?")
|
name = models.CharField(max_length=255, unique=True, help_text="What is the name of your organization?")
|
||||||
email = models.EmailField(help_text="What is your email?")
|
email = models.EmailField(unique=True, help_text="What is your email?")
|
||||||
employee_headcount = models.CharField(max_length=20, help_text="What is your organization's current employee headcount?")
|
employee_headcount = models.CharField(max_length=20, help_text="What is your organization's current employee headcount?")
|
||||||
annual_revenue = models.CharField(max_length=20, help_text="What is your organization's annual revenue range?")
|
annual_revenue = models.CharField(max_length=20, help_text="What is your organization's annual revenue range?")
|
||||||
critical_applications = models.CharField(max_length=20, help_text="How many critical business applications do your employees use daily?")
|
critical_applications = models.CharField(max_length=20, help_text="How many critical business applications do your employees use daily?")
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ from backend.accounts.utils import send_confirmation_email, send_document_email
|
|||||||
from django.contrib.admin.views.decorators import staff_member_required
|
from django.contrib.admin.views.decorators import staff_member_required
|
||||||
from django.template import Template, Context
|
from django.template import Template, Context
|
||||||
from .utils import generate_pdf
|
from .utils import generate_pdf
|
||||||
|
from django.conf import settings
|
||||||
|
site_domain = settings.SITE_DOMAIN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -110,7 +112,7 @@ def payment_page(request):
|
|||||||
document = get_object_or_404(Document, organization=organization)
|
document = get_object_or_404(Document, organization=organization)
|
||||||
|
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
pdf_url = f"http://127.0.0.1:8000/pdf/{document.id}"
|
pdf_url = f"{site_domain}/document/{document.id}/"
|
||||||
send_document_email(email, pdf_url, document)
|
send_document_email(email, pdf_url, document)
|
||||||
return redirect(pdf_url)
|
return redirect(pdf_url)
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ DEBUG = config('DEBUG', default=False, cast=bool)
|
|||||||
|
|
||||||
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[], cast=Csv())
|
ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[], cast=Csv())
|
||||||
|
|
||||||
|
SITE_DOMAIN = "http://64.226.105.114"
|
||||||
|
|
||||||
# Application definition
|
# Application definition
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user