Include email settings specific to Catapult mirror

This commit is contained in:
Lance Edgar 2020-09-26 15:18:02 -05:00
parent a290e8af93
commit c707e2261c
3 changed files with 43 additions and 1 deletions

View file

@ -8,6 +8,8 @@
[theo]
## POS integration
% if env.theo_integrates_with == 'corepos':
integrate_corepos = true
% elif env.theo_integrates_with == 'catapult':
@ -16,6 +18,9 @@ integrate_catapult = true
integrate_locsms = true
% endif
## POS DB mirror
mirror_posdb = ${'true' if env.theo_mirror_posdb else 'false'}
## begin corepos
% if env.theo_integrates_with == 'corepos':

View file

@ -52,7 +52,10 @@ class TheoConfig(ConfigExtension):
elif integrate_catapult(config):
config.setdefault('rattail', 'model', 'theo.db.model_catapult')
config.setdefault('rattail', 'settings', 'theo.appsettings.theo, theo.appsettings.catapult')
config.setdefault('rattail.mail', 'emails', 'theo.emails.theo, theo.emails.catapult')
emails = ['theo.emails.theo', 'theo.emails.catapult']
if mirror_posdb(config):
emails.append('theo.emails.catapult_mirror')
config.setdefault('rattail.mail', 'emails', ', '.join(emails))
config.setdefault('rattail.importing', 'versions.handler', 'theo.importing.versions_catapult:FromTheoToTheoVersions')
# do we integrate w/ LOC SMS?
@ -80,3 +83,8 @@ def integrate_corepos(config):
def integrate_locsms(config):
return config.getbool('theo', 'integrate_locsms', default=False,
usedb=False)
def mirror_posdb(config):
return config.getbool('theo', 'mirror_posdb', default=False,
usedb=False)

View file

@ -0,0 +1,29 @@
# -*- coding: utf-8; -*-
################################################################################
#
# Rattail -- Retail Software Framework
# Copyright © 2010-2020 Lance Edgar
#
# This file is part of Rattail.
#
# Rattail is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# Rattail is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# Rattail. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
"""
Theo email profile settings
"""
from rattail_onager.emails import (
rattail_onager_import_catapult_updates,
)