Jul 17 - Fill the gaps between Single-tenant mode and Multi-tenant mode - MT7
This commit is contained in:
@@ -179,7 +179,6 @@ def _send_invite_email(user, token, base_url=None):
|
||||
from flask import current_app, render_template_string
|
||||
from flask_mail import Message
|
||||
from app import mail
|
||||
from urllib.parse import urlparse
|
||||
import threading
|
||||
|
||||
if not current_app.config.get('MAIL_SERVER'):
|
||||
@@ -189,8 +188,14 @@ def _send_invite_email(user, token, base_url=None):
|
||||
effective_base = (base_url or current_app.config.get('APP_BASE_URL', '')).rstrip('/')
|
||||
setup_link = f'{effective_base}{url_for("customers.set_password", token=token)}'
|
||||
|
||||
host = urlparse(effective_base).netloc or 'janitorialqc.local'
|
||||
sender = f'noreply@{host}'
|
||||
# Branded From as a (display_name, address) tuple. The display NAME tracks
|
||||
# the tenant (e.g. "Gov Services QC"); the ADDRESS is branded only for
|
||||
# DNS-authorized domains and otherwise stays the authenticated identity so
|
||||
# the mail always delivers. The previous `noreply@{host}` sent from whatever
|
||||
# host the browser was on, which fails SPF/DMARC for any domain this mail
|
||||
# server isn't authorized for. See app/utils/mail_utils.py and rule 64.
|
||||
from app.utils.mail_utils import branded_sender
|
||||
sender = branded_sender(effective_base)
|
||||
|
||||
html_body = render_template_string("""<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
@@ -66,7 +66,7 @@ def _save_report_photos(file_list):
|
||||
under "Photo Evidence" on the web (rule 44 — never `result_photos`).
|
||||
|
||||
Writes go through `_save_photo`, which validates magic bytes and routes to
|
||||
the active storage backend (MT-2).
|
||||
the active storage backend (see app/utils/storage.py).
|
||||
"""
|
||||
from app.routes.inspections import _save_photo
|
||||
saved = []
|
||||
|
||||
Reference in New Issue
Block a user