Use handler to get CORE Office URLs
instead of deprecated config function
This commit is contained in:
parent
0b7f3d8dcc
commit
045940d4fa
13 changed files with 66 additions and 82 deletions
|
@ -28,7 +28,6 @@ from corepos.db.office_op import model as corepos
|
|||
|
||||
from rattail_corepos.db.model import CoreMemberBatch, CoreMemberBatchRow
|
||||
from rattail_corepos.batch.coremember import CoreMemberBatchHandler
|
||||
from rattail_corepos.config import core_office_url, core_office_customer_account_url
|
||||
|
||||
from tailbone.views.batch import BatchMasterView
|
||||
from tailbone_corepos.db import CoreOfficeSession
|
||||
|
@ -131,6 +130,7 @@ class CoreMemberBatchView(BatchMasterView):
|
|||
return 'notice'
|
||||
|
||||
def template_kwargs_view_row(self, **kwargs):
|
||||
app = self.get_rattail_app()
|
||||
batch = kwargs['parent_instance']
|
||||
row = kwargs['instance']
|
||||
kwargs['batch'] = batch
|
||||
|
@ -149,13 +149,12 @@ class CoreMemberBatchView(BatchMasterView):
|
|||
# CORE Office URL
|
||||
kwargs['core_office_url'] = None
|
||||
if row.card_number:
|
||||
office_url = core_office_url(self.rattail_config)
|
||||
corepos = app.get_corepos_handler()
|
||||
office_url = corepos.get_office_url()
|
||||
if not office_url:
|
||||
kwargs['core_office_why_no_url'] = "CORE Office URL is not configured"
|
||||
else:
|
||||
url = core_office_customer_account_url(self.rattail_config,
|
||||
row.card_number,
|
||||
office_url=office_url)
|
||||
url = corepos.get_office_member_url(row.card_number, office_url=office_url)
|
||||
if url:
|
||||
kwargs['core_office_url'] = url
|
||||
else:
|
||||
|
|
|
@ -28,7 +28,6 @@ from corepos.db.office_op import model as corepos
|
|||
|
||||
from rattail_corepos.db.model import CoreEquityImportBatch, CoreEquityImportBatchRow
|
||||
from rattail_corepos.batch.equityimport import CoreEquityImportBatchHandler
|
||||
from rattail_corepos.config import core_office_url, core_office_customer_account_url
|
||||
|
||||
from webhelpers2.html import tags
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue