Commit a5b7c244 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_subscription_request: Allow to set target_language via command line on the request.

parent ac2ec485
...@@ -21,4 +21,4 @@ user_input_dict = { ...@@ -21,4 +21,4 @@ user_input_dict = {
return context.SubscriptionRequestModule_requestSubscriptionProxy( return context.SubscriptionRequestModule_requestSubscriptionProxy(
default_email_text, subscription_reference, default_email_text, subscription_reference,
confirmation_required=bool(confirmation_required), confirmation_required=bool(confirmation_required),
user_input_dict=user_input_dict, batch_mode=0) user_input_dict=user_input_dict, target_language=target_language, batch_mode=0)
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>name=None, default_email_text=None, subscription_reference=None, amount=0, confirmation_required=True, REQUEST=None, **kw</string> </value> <value> <string>name=None, default_email_text=None, subscription_reference=None, amount=0, confirmation_required=True, target_language=None, REQUEST=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -19,7 +19,8 @@ if confirmation_required and not person_is_new: ...@@ -19,7 +19,8 @@ if confirmation_required and not person_is_new:
user_input_dict["amount"], user_input_dict["amount"],
subscription_reference)) subscription_reference))
target_language = context.getPortalObject().Localizer.get_selected_language() if target_language is None:
target_language = context.getPortalObject().Localizer.get_selected_language()
subscription_request = context.subscription_request_module.newContent( subscription_request = context.subscription_request_module.newContent(
portal_type="Subscription Request", portal_type="Subscription Request",
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>email, subscription_reference, confirmation_required=False, user_input_dict={}, batch_mode=True, REQUEST=None</string> </value> <value> <string>email, subscription_reference, confirmation_required=False, user_input_dict={}, target_language=None, batch_mode=True, REQUEST=None</string> </value>
</item> </item>
<item> <item>
<key> <string>_proxy_roles</string> </key> <key> <string>_proxy_roles</string> </key>
......
...@@ -245,7 +245,7 @@ class TestSubscriptionRequestModule_requestSubscription(TestSubscriptionSkinsMix ...@@ -245,7 +245,7 @@ class TestSubscriptionRequestModule_requestSubscription(TestSubscriptionSkinsMix
name="couscous") name="couscous")
expected_argument_tuple = (('123@nexedi.com', 'subscription_reference'), expected_argument_tuple = (('123@nexedi.com', 'subscription_reference'),
{'confirmation_required': True, 'user_input_dict': {'name': "couscous", 'amount': 0}, 'batch_mode': 0}) {'confirmation_required': True, 'user_input_dict': {'name': "couscous", 'amount': 0}, 'target_language': None, 'batch_mode': 0})
self.assertEqual(expected_argument_tuple, module.SubscriptionRequestModule_requestSubscription( self.assertEqual(expected_argument_tuple, module.SubscriptionRequestModule_requestSubscription(
REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com", REQUEST=self.portal.REQUEST, default_email_text="123@nexedi.com",
......
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