Commit e47964f0 authored by Romain Courteaud's avatar Romain Courteaud

erp5_forge: start to break vcs for erp5js

parent 2d2f2b57
from ZTUtils import make_query from Products.ERP5Type.Message import translateString
form_results = context.BusinessTemplate_viewCreateWorkingCopy.validate_all(REQUEST) form_results = context.BusinessTemplate_viewCreateWorkingCopy.validate_all(REQUEST)
working_copy = form_results['your_repository'] working_copy = form_results['your_repository']
context.getVcsTool(path=working_copy).createBusinessTemplateWorkingCopy() context.getVcsTool(path=working_copy).createBusinessTemplateWorkingCopy()
query_string = make_query(portal_status_message='Business Template Working Copy created') return context.Base_redirect('BusinessTemplate_viewVcsStatus', keep_items=dict(
REQUEST.response.redirect('%s/BusinessTemplate_viewVcsStatus?%s' % portal_status_message=translateString('Business Template Working Copy created')
(context.absolute_url_path(), query_string)) ))
...@@ -15,7 +15,7 @@ if not changelog.strip(): ...@@ -15,7 +15,7 @@ if not changelog.strip():
request.set('cancel_url', context.absolute_url() + request.set('cancel_url', context.absolute_url() +
'/BusinessTemplate_viewVcsStatus?do_extract:int=0' '/BusinessTemplate_viewVcsStatus?do_extract:int=0'
'&portal_status_message=Commit%20cancelled.') '&portal_status_message=Commit%20cancelled.')
return context.asContext(**kw).BusinessTemplate_viewVcsChangelog() return context.asContext(**kw).Base_renderForm('BusinessTemplate_viewVcsChangelog')
try: try:
return context.getVcsTool().commit(changelog, **kw) return context.getVcsTool().commit(changelog, **kw)
......
...@@ -17,4 +17,4 @@ except GitLoginError, e: ...@@ -17,4 +17,4 @@ except GitLoginError, e:
method = 'BusinessTemplate_viewGitLogin' method = 'BusinessTemplate_viewGitLogin'
context.REQUEST.set('portal_status_message', message) context.REQUEST.set('portal_status_message', message)
return getattr(context.asContext(**kw), method)(caller=caller, caller_kw=caller_kw) return context.asContext(**kw).Base_renderForm(method, caller=caller, caller_kw=caller_kw)
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