Esempio n. 1
0
 def __init__(self, customer_id=None, service_email=None):
     self.customer_id = customer_id
     self.service_email = service_email
     if service_email is not None:
         msg = 'Customer with service email %s not found' % service_email
     else:
         msg = 'Customer with id %d not found' % customer_id
     logging.error(msg)
     BusinessException.__init__(self, msg)
Esempio n. 2
0
 def __init__(self, user_language, missing_scopes):
     localized_scopes = set()
     for scope in missing_scopes:
         if scope == MdpScope.EMAIL:
             localized_scopes.add(localize(user_language, 'E-mail address'))
         elif scope == MdpScope.ADDRESS:
             localized_scopes.add(localize(user_language, 'Address'))
         elif scope == MdpScope.PHONE:
             localized_scopes.add(localize(user_language, 'Phone number'))
         elif scope == MdpScope.PROFILE:
             localized_scopes.add(localize(user_language, 'Profile'))
         elif scope in (MdpScope.EID_ADDRESS, MdpScope.EID_PHOTO, MdpScope.EID_PROFILE):
             localized_scopes.add(localize(user_language, 'eID data'))
     missing_data = u''.join((u'\n• %s' % scope for scope in sorted(localized_scopes)))
     BusinessException.__init__(self, localize(user_language, u'mdp_missing_scopes', missing_data=missing_data))
Esempio n. 3
0
 def __init__(self, app_id):
     self.app_id = app_id
     BusinessException.__init__(self, 'App with id %s does not exist' % app_id)
Esempio n. 4
0
 def __init__(self, existing_subscription_order_number):
     self.existing_subscription_order_number = existing_subscription_order_number
     BusinessException.__init__(self, "Customer already has a subscription: %s" % existing_subscription_order_number)
Esempio n. 5
0
 def __init__(self, product_description, dependency_description):
     BusinessException.__init__(self, "\"%s\" cannot be ordered without the same quantity \"%s\"." % (
         product_description, dependency_description))
Esempio n. 6
0
 def __init__(self, product_description):
     self.product_description = product_description
     BusinessException.__init__(self, "Product \"%s\" is not allowed for this customer." % product_description)
Esempio n. 7
0
 def __init__(self, product_name):
     self.product_name = product_name
     BusinessException.__init__(self, "Product \"%s\" does not exist." % product_name)
Esempio n. 8
0
 def __init__(self, contact_id):
     msg = 'Contact with id %s has one or more credit cards assigned to it so it cannot be deleted.' % contact_id
     BusinessException.__init__(self, msg)
Esempio n. 9
0
 def __init__(self, email):
     self.email = email
     BusinessException.__init__(self, "This customer already had a service, but with e-mail address '%s'" % email)
Esempio n. 10
0
 def __init__(self, max_app_count):
     self.max_app_count = max_app_count
     extraS = 's' if self.max_app_count != 1 else ''
     BusinessException.__init__(self, 'This customer should have exactly %d active application%s.' % (
         max_app_count, extraS))
Esempio n. 11
0
 def __init__(self, disallowed_modules):
     self.disallowed_modules = disallowed_modules
     BusinessException.__init__(self, "This customer cannot have the following module(s): %s." % ", ".join(
             map(replace_underscores, disallowed_modules)))
Esempio n. 12
0
 def __init__(self):
     BusinessException.__init__(self,
                                "This customer does not have an order yet. First create an order for this customer.")
Esempio n. 13
0
 def __init__(self, order):
     self.order = order
     BusinessException.__init__(self, 'Order %s has already been canceled' % order.order_number)
Esempio n. 14
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'Customer %s has no subscription yet' % customer.name)
Esempio n. 15
0
 def __init__(self, extra_apps_count, total_extra_app_count):
     BusinessException.__init__(self, 'You cannot order %s extra apps because there are only %s available'
                                % (extra_apps_count, total_extra_app_count))
Esempio n. 16
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'customer %s has no credit hard linked' % customer.name)
Esempio n. 17
0
 def __init__(self, team):
     self.team = team
     BusinessException.__init__(self, 'Regiomanager team %s has no support manager' % team.name)
Esempio n. 18
0
 def __init__(self, email):
     self.email = email
     BusinessException.__init__(self, '\"%s\" is not a valid email address.' % email)
Esempio n. 19
0
 def __init__(self, contact_id):
     msg = 'Contact with id %d not found' % contact_id
     logging.error(msg)
     BusinessException.__init__(self, msg)
Esempio n. 20
0
 def __init__(self, value_name):
     # value_name has to be a translate key in common translation
     self.value_name = value_name
     BusinessException.__init__(self, "The value \"%s\" is not filled in." % replace_underscores(value_name))
Esempio n. 21
0
 def __init__(self):
     BusinessException.__init__(self, 'No products selected')
Esempio n. 22
0
 def __init__(self):
     BusinessException.__init__(self, "Invalid service name (length > 50 characters)")
Esempio n. 23
0
 def __init__(self, amount, product_name):
     self.amount = amount
     self.product_name = product_name
     BusinessException.__init__(self,
                                '%d is not a valid amount of items for product \"%s\"' % (amount, product_name))
Esempio n. 24
0
 def __init__(self, lang):
     self.lang = lang
     BusinessException.__init__(self, "The language \"%s\" is not supported." % lang)
Esempio n. 25
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'No subscription found for customer %s' % customer.name)
Esempio n. 26
0
 def __init__(self, country):
     self.country = country
     msg = 'Sorry, we currently do not operate in %s yet.' % country
     logging.error(msg)
     BusinessException.__init__(self, msg)
Esempio n. 27
0
 def __init__(self, action=None):
     self.action = action
     BusinessException.__init__(self, 'You don\'t have permission to execute this action (%s)' % replace_underscores(
         self.action or sys._getframe(1).f_code.co_name))
Esempio n. 28
0
 def __init__(self, product_description, dependency_description):
     self.product_description = product_description
     self.dependency_description = dependency_description
     BusinessException.__init__(self,
                                "\"%s\" cannot be ordered without \"%s\" in this or a previously signed order." % (
                                    product_description, dependency_description))