Make CORE API client via app handler, not deprecated function
This commit is contained in:
parent
7b9b6e57e2
commit
ebdb658a2c
5 changed files with 8 additions and 16 deletions
|
@ -34,7 +34,6 @@ from rattail import commands
|
|||
from rattail_corepos import __version__
|
||||
from rattail.util import load_object
|
||||
from rattail_corepos.corepos.office.util import get_fannie_config_value
|
||||
from rattail_corepos.corepos.api import make_corepos_api
|
||||
from rattail_corepos.corepos.util import get_core_members
|
||||
from rattail_corepos.config import core_office_url
|
||||
|
||||
|
@ -91,10 +90,7 @@ class Anonymize(commands.Subcommand):
|
|||
"\tpip install names\n")
|
||||
sys.exit(2)
|
||||
|
||||
from rattail_corepos.corepos.api import make_corepos_api
|
||||
from rattail_corepos.corepos.util import get_core_members
|
||||
|
||||
api = make_corepos_api(self.config)
|
||||
api = self.app.get_corepos_handler().make_webapi()
|
||||
members = get_core_members(self.config, api, progress=self.progress)
|
||||
|
||||
def anonymize(member, i):
|
||||
|
@ -236,7 +232,7 @@ class PatchCustomerGaps(commands.Subcommand):
|
|||
def run(self, args):
|
||||
from corepos.db.office_op import model as corepos
|
||||
|
||||
corepos_api = make_corepos_api(self.config)
|
||||
corepos_api = self.app.get_corepos_handler().make_webapi()
|
||||
members = get_core_members(self.config, corepos_api, progress=self.progress)
|
||||
tally = self.app.make_object(updated=0)
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ CORE-POS model importers (webservices API)
|
|||
from rattail import importing
|
||||
from rattail.util import data_diffs
|
||||
from rattail_corepos.corepos.util import get_core_members
|
||||
from rattail_corepos.corepos.api import make_corepos_api
|
||||
|
||||
|
||||
class ToCOREAPIHandler(importing.ImportHandler):
|
||||
|
@ -83,7 +82,7 @@ class ToCoreAPI(importing.Importer):
|
|||
self.establish_api()
|
||||
|
||||
def establish_api(self):
|
||||
self.api = make_corepos_api(self.config)
|
||||
self.api = self.app.get_corepos_handler().make_webapi()
|
||||
|
||||
def ensure_fields(self, data):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue