Commit fe64bea0 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Require that email is always provided

parent 0f638a62
......@@ -44,6 +44,9 @@ def SubscriptionRequest_searchExistingUserByEmail(self, email, REQUEST=None):
raise Unauthorized
portal = self.getPortalObject()
if email in ["", None]:
return
erp5_login_list = portal.portal_catalog.unrestrictedSearchResults(
portal_type="ERP5 Login",
reference=email,
......
......@@ -6,6 +6,22 @@ if REQUEST is not None:
portal = context.getPortalObject()
web_site = context.getWebSiteValue()
if email in ["", None]:
error = "Email must be provided"
base_url = context.getWebSectionValue().absolute_url()
redirect_url = "%s?field_your_reservation_name=%s&field_your_reservation_email=%s&field_your_reservation_number_of_machines=%s&field_your_reservation_network=%s&field_your_reservation_invitation_token=%s&portal_status_message=%s" % (
base_url,
user_input_dict['name'],
email,
user_input_dict["amount"],
subscription_reference,
token,
error
)
return context.REQUEST.RESPONSE.redirect(redirect_url)
if token:
error = ""
try:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment