Ignore:
Timestamp:
21 Nov 2014, 18:52:43 (10 years ago)
Author:
Henrik Bettermann
Message:

Implement translated_state property correctly so that we can more easily customized customer registration and document verification state names.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.ikoba/trunk/src/waeup/ikoba/customers/customer.py

    r12005 r12032  
    3636from waeup.ikoba.interfaces import (
    3737    IObjectHistory, IUserAccount, IFileStoreNameChooser, IFileStoreHandler,
    38     IIkobaUtils, registration_states_vocab, IExtFileStore,
     38    IIkobaUtils, IExtFileStore,
    3939    CREATED, REQUESTED, APPROVED)
    4040from waeup.ikoba.customers.export import EXPORTER_NAMES
    4141from waeup.ikoba.customers.interfaces import (
    42     ICustomer, ICustomerNavigation, ICSVCustomerExporter)
     42    ICustomer, ICustomerNavigation, ICSVCustomerExporter,
     43    ICustomersUtils)
    4344from waeup.ikoba.customers.utils import generate_customer_id
    4445from waeup.ikoba.customers.documents import CustomerDocumentsContainer
     
    126127    @property
    127128    def translated_state(self):
    128         state = registration_states_vocab.getTermByToken(
    129             self.state).title
    130         return state
     129        try:
     130            TRANSLATED_STATES = getUtility(ICustomersUtils).TRANSLATED_STATES
     131            ts = TRANSLATED_STATES[self.state]
     132            return ts
     133        except KeyError:
     134            return
    131135
    132136    @property
Note: See TracChangeset for help on using the changeset viewer.