Add core_office_customer_account_url() convenience/config function

This commit is contained in:
Lance Edgar 2020-03-17 12:46:13 -05:00
parent 35c74ff996
commit 8d47a1449c

View file

@ -62,3 +62,14 @@ def core_office_url(config, require=False, **kwargs):
url = config.get(*args, **kwargs) url = config.get(*args, **kwargs)
if url: if url:
return url.rstrip('/') return url.rstrip('/')
def core_office_customer_account_url(config, card_number, office_url=None):
"""
Returns the CORE Office URL for the customer account with the given card
number.
"""
if not office_url:
office_url = core_office_url(config, require=True)
return '{}/mem/MemberEditor.php?memNum={}'.format(
office_url, card_number)