Minor bugfixes.
This commit is contained in:
parent
2ecd2d7ef1
commit
500637eb53
|
@ -1,5 +1,6 @@
|
|||
# ------------------------------------------------------------------------------
|
||||
import re, time
|
||||
from appy.shared.utils import Traceback
|
||||
from appy.gen.utils import sequenceTypes, PageDescr
|
||||
from appy.shared.data import countries
|
||||
|
||||
|
@ -436,7 +437,8 @@ class Action(Type):
|
|||
# anything), we consider the action as successfull.
|
||||
if res[0] == None: res[0] = True
|
||||
except Exception, e:
|
||||
res = (False, str(e))
|
||||
res = (False, 'An error occurred. %s' % str(e))
|
||||
obj.log(Traceback.get(), type='error')
|
||||
return res
|
||||
|
||||
class Info(Type):
|
||||
|
|
|
@ -162,6 +162,8 @@ class Generator(AbstractGenerator):
|
|||
self.copyFile('Portlet.pt', self.repls,
|
||||
destName='%s.pt' % self.portletName, destFolder=self.skinsFolder)
|
||||
self.copyFile('tool.gif', {})
|
||||
self.copyFile(
|
||||
'global_statusmessage.pt', {}, destFolder=self.skinsFolder)
|
||||
self.copyFile('Styles.css.dtml',self.repls, destFolder=self.skinsFolder,
|
||||
destName = '%s.css.dtml' % self.applicationName)
|
||||
self.copyFile('IEFixes.css.dtml',self.repls,destFolder=self.skinsFolder)
|
||||
|
|
|
@ -775,6 +775,7 @@ class AbstractMixin:
|
|||
msg = self.translate(u'Your content\'s status has been modified.',
|
||||
domain='plone')
|
||||
self.plone_utils.addPortalMessage(msg)
|
||||
self.reindexObject()
|
||||
return self.goto(urlBack)
|
||||
|
||||
def callAppySelect(self, selectMethod, brains):
|
||||
|
@ -1110,9 +1111,9 @@ class AbstractMixin:
|
|||
performs inter-field validation. This way, the user must first
|
||||
correct individual fields before being confronted to potential
|
||||
inter-fields validation errors.'''
|
||||
obj = self._appy_getWrapper()
|
||||
obj = self.appy()
|
||||
if not hasattr(obj, 'validate'): return
|
||||
appyRequest = getAppyRequest(REQUEST, obj)
|
||||
try:
|
||||
appyErrors = ValidationErrors()
|
||||
obj.validate(appyRequest, appyErrors)
|
||||
# This custom "validate" method may have added fields in the given
|
||||
|
@ -1126,8 +1127,6 @@ class AbstractMixin:
|
|||
msgId = '%s_valid' % self.getLabelPrefix(key)
|
||||
resValue = self.utranslate(msgId, domain=self.i18nDomain)
|
||||
errors[key] = resValue
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def _appy_getPortalType(self, request):
|
||||
'''Guess the portal_type of p_self from info about p_self and
|
||||
|
|
20
gen/plone25/templates/global_statusmessage.pt
Normal file
20
gen/plone25/templates/global_statusmessage.pt
Normal file
|
@ -0,0 +1,20 @@
|
|||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" i18n:domain="plone">
|
||||
<body>
|
||||
<tal:message i18n:domain="plone" metal:define-macro="portal_message">
|
||||
<tal:comment replace="nothing">Single message from portal_status_message request key</tal:comment>
|
||||
<div tal:define="msg request/portal_status_message | nothing"
|
||||
tal:condition="msg" class="portalMessage" tal:content="msg" i18n:translate=""></div>
|
||||
|
||||
<tal:comment replace="nothing">Messages added via plone_utils</tal:comment>
|
||||
<tal:messages define="messages putils/showPortalMessages" condition="messages">
|
||||
<tal:msgs define="type_css_map python: {'info':'portalMessage', 'warn':'portalWarningMessage',
|
||||
'stop':'portalStopMessage'};"
|
||||
repeat="msg messages">
|
||||
<div tal:define="mtype msg/type | nothing;"
|
||||
tal:attributes="class python:mtype and type_css_map[mtype] or 'info';"
|
||||
tal:content="structure msg/message | nothing" i18n:translate=""></div>
|
||||
</tal:msgs>
|
||||
</tal:messages>
|
||||
</tal:message>
|
||||
</body>
|
||||
</html>
|
|
@ -160,7 +160,7 @@ def do(transitionName, stateChange, logger):
|
|||
# We do not notify if the "notify" flag in the flavour is disabled.
|
||||
doNotify = False
|
||||
if doAction or doNotify:
|
||||
obj = ploneObj._appy_getWrapper(force=True)
|
||||
obj = ploneObj.appy()
|
||||
if doAction:
|
||||
if type(transition.action) in (tuple, list):
|
||||
# We need to execute a list of actions
|
||||
|
|
Loading…
Reference in a new issue