Exemple #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)
Exemple #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))
Exemple #3
0
 def __init__(self, app_id):
     self.app_id = app_id
     BusinessException.__init__(self, 'App with id %s does not exist' % app_id)
Exemple #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)
Exemple #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))
Exemple #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)
Exemple #7
0
 def __init__(self, product_name):
     self.product_name = product_name
     BusinessException.__init__(self, "Product \"%s\" does not exist." % product_name)
Exemple #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)
Exemple #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)
Exemple #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))
Exemple #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)))
Exemple #12
0
 def __init__(self):
     BusinessException.__init__(self,
                                "This customer does not have an order yet. First create an order for this customer.")
Exemple #13
0
 def __init__(self, order):
     self.order = order
     BusinessException.__init__(self, 'Order %s has already been canceled' % order.order_number)
Exemple #14
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'Customer %s has no subscription yet' % customer.name)
Exemple #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))
Exemple #16
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'customer %s has no credit hard linked' % customer.name)
Exemple #17
0
 def __init__(self, team):
     self.team = team
     BusinessException.__init__(self, 'Regiomanager team %s has no support manager' % team.name)
Exemple #18
0
 def __init__(self, email):
     self.email = email
     BusinessException.__init__(self, '\"%s\" is not a valid email address.' % email)
Exemple #19
0
 def __init__(self, contact_id):
     msg = 'Contact with id %d not found' % contact_id
     logging.error(msg)
     BusinessException.__init__(self, msg)
Exemple #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))
Exemple #21
0
 def __init__(self):
     BusinessException.__init__(self, 'No products selected')
Exemple #22
0
 def __init__(self):
     BusinessException.__init__(self, "Invalid service name (length > 50 characters)")
Exemple #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))
Exemple #24
0
 def __init__(self, lang):
     self.lang = lang
     BusinessException.__init__(self, "The language \"%s\" is not supported." % lang)
Exemple #25
0
 def __init__(self, customer):
     self.customer = customer
     BusinessException.__init__(self, 'No subscription found for customer %s' % customer.name)
Exemple #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)
Exemple #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))
Exemple #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))