Various flake8 fixes.
- Removed tabs. - Fixed E731 do not assign a lambda expression, use a def. - avoid hasattr
This commit is contained in:
parent
cdb48ba87a
commit
814af8d837
@ -29,6 +29,7 @@ Bug fixes:
|
||||
user to fill in the form without validation error. Or when in the
|
||||
control panel the field is set as not required anymore, that change
|
||||
would have no effect until the instance was restarted. [maurits]
|
||||
- Cleaned code from flake8 errors. [maurits]
|
||||
|
||||
|
||||
2.4.14 (2016-06-06)
|
||||
|
@ -8,6 +8,7 @@ from Products.CMFCore.interfaces import IFolderish
|
||||
from Products.CMFCore.utils import getToolByName
|
||||
from Products.CMFPlone.interfaces import INonStructuralFolder
|
||||
from Products.CMFPlone.interfaces import IPloneSiteRoot
|
||||
from Products.CMFPlone.utils import safe_hasattr
|
||||
from zope.component import queryUtility
|
||||
|
||||
|
||||
@ -132,7 +133,7 @@ class ConversationView(object):
|
||||
return False
|
||||
|
||||
# Check if discussion is allowed on the content object
|
||||
if hasattr(context, 'allow_discussion'):
|
||||
if safe_hasattr(context, 'allow_discussion'):
|
||||
if context.allow_discussion is not None:
|
||||
return context.allow_discussion
|
||||
|
||||
|
@ -17,7 +17,8 @@ except ImportError:
|
||||
try:
|
||||
from plone.app.contentrules.handlers import execute
|
||||
except ImportError:
|
||||
execute = lambda context, event: False
|
||||
def execute(context, event):
|
||||
return False
|
||||
|
||||
|
||||
def execute_comment(event):
|
||||
|
Loading…
Reference in New Issue
Block a user