X-Git-Url: https://svn.cri.ensmp.fr/git/photoprint.git/blobdiff_plain/bddfc31eaf67003a04f79f7cf168b8d840920fd6..f4c99bcdc9425cde32f0323811cf737e0d567070:/skins/customer_add_control.py diff --git a/skins/customer_add_control.py b/skins/customer_add_control.py index 274f4c6..6efd42b 100755 --- a/skins/customer_add_control.py +++ b/skins/customer_add_control.py @@ -1,7 +1,9 @@ ##parameters=**kw from Products.CMFCore.utils import getToolByName -from Products.realis.utils import translate +from Products.photoprint.utils import translate from Products.CMFDefault.utils import translate as cmf_translate +from Products.CMFCore.exceptions import AccessControl_Unauthorized +from Products.Plinn.RegistrationTool import MODE_PASS_ANONYMOUS rtool = getToolByName(context, 'portal_registration') ptool = getToolByName(context, 'portal_properties') _ = lambda msg : translate(msg, context) @@ -25,7 +27,6 @@ mandatoryFields = [ , ('billing_zipcode', _('Please enter zip code.')) , ('country', _('Please enter a country.')) , ('phone', _('Please enter a phone.')) - , ('accept_gcs', _('Please accept general conditions of sales.')) ] for name, failMessage in mandatoryFields : @@ -46,9 +47,14 @@ try: ,'billing_zipcode' : kg('billing_zipcode') ,'country' : kg('country') ,'phone' : kg('phone') - ,'accept_gcs' : kg('accep_gcs')} ) + ,'collection_id' : kg('collection_id') + ,'collection_password': kg('collection_password')} ) except ValueError, errmsg: return context.setStatus(False, _(errmsg)) +except AccessControl_Unauthorized : + if rtool.getMode() == MODE_PASS_ANONYMOUS : + return context.setStatus(False, _('Wrong private collection credentials.')) + raise if kg('send_password') or ptool.getProperty('validate_email') :