Commit 3b7784e4 authored by Romain Courteaud's avatar Romain Courteaud

erp5_forge: handle SVN exception

parent 664df735
...@@ -56,4 +56,4 @@ try: ...@@ -56,4 +56,4 @@ try:
removed=commit_dict['removed'] removed=commit_dict['removed']
) )
except Exception, error: except Exception, error:
return context.BusinessTemplate_handleException(error, script.id, commit_dict=commit_dict) return context.BusinessTemplate_handleException(error, script.id, commit_dict)
import json
commit_dict = json.loads(commit_json) if commit_json is not None else {
'keep': keep
}
if keep:
commit_dict['keep'] = keep
try: try:
new_bt = context.getVcsTool().update(keep) new_bt = context.getVcsTool().update(commit_dict['keep'])
except Exception, error: except Exception, error:
return context.BusinessTemplate_handleException( return context.BusinessTemplate_handleException(
error, script.id, form_id=form_id, keep=keep) error, script.id, commit_dict)
return new_bt.Base_redirect('BusinessTemplate_viewInstallationDialog', keep_items={ return new_bt.Base_redirect('BusinessTemplate_viewInstallationDialog', keep_items={
'portal_status_message': 'Working copy updated successfully.', 'portal_status_message': 'Working copy updated successfully.',
'workflow_action': 'install_action', 'workflow_action': 'install_action',
'form_id': form_id 'form_id': 'view'
}) })
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>form_id=\'view\', keep=False</string> </value> <value> <string>commit_json=None, keep=False</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -18,11 +18,10 @@ except GitLoginError, e: ...@@ -18,11 +18,10 @@ except GitLoginError, e:
method = 'BusinessTemplate_viewGitLogin' method = 'BusinessTemplate_viewGitLogin'
commit_dict['caller'] = caller commit_dict['caller'] = caller
# XXX caller_kw
# Always propage all informations throught formulator hidden field # Always propage all informations throught formulator hidden field
request = context.REQUEST request = context.REQUEST
request.form['your_commit_json'] = json.dumps(commit_dict) request.form['your_commit_json'] = json.dumps(commit_dict)
return context.Base_renderForm(method, keep_items={ return context.asContext(**kw).Base_renderForm(method, keep_items={
'portal_status_message': message 'portal_status_message': message
}) })
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>exception, caller, commit_dict, **caller_kw</string> </value> <value> <string>exception, caller, commit_dict</string> </value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python: context.getVcsTool().getRemoteUrl()</string> </value> <value> <string>here/remote_url</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
<list> <list>
<string>left</string> <string>left</string>
<string>right</string> <string>right</string>
<string>center</string>
<string>bottom</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -72,6 +74,20 @@ ...@@ -72,6 +74,20 @@
<key> <string>groups</string> </key> <key> <string>groups</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>your_commit_json</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
......
...@@ -65,6 +65,8 @@ ...@@ -65,6 +65,8 @@
<list> <list>
<string>left</string> <string>left</string>
<string>right</string> <string>right</string>
<string>center</string>
<string>bottom</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -72,6 +74,20 @@ ...@@ -72,6 +74,20 @@
<key> <string>groups</string> </key> <key> <string>groups</string> </key>
<value> <value>
<dictionary> <dictionary>
<item>
<key> <string>bottom</string> </key>
<value>
<list>
<string>your_commit_json</string>
</list>
</value>
</item>
<item>
<key> <string>center</string> </key>
<value>
<list/>
</value>
</item>
<item> <item>
<key> <string>left</string> </key> <key> <string>left</string> </key>
<value> <value>
......
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