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
|
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
|
control panel the field is set as not required anymore, that change
|
||||||
would have no effect until the instance was restarted. [maurits]
|
would have no effect until the instance was restarted. [maurits]
|
||||||
|
- Cleaned code from flake8 errors. [maurits]
|
||||||
|
|
||||||
|
|
||||||
2.4.14 (2016-06-06)
|
2.4.14 (2016-06-06)
|
||||||
|
@ -37,8 +37,8 @@
|
|||||||
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
||||||
has_author_link python:author_home_url and not isAnon;
|
has_author_link python:author_home_url and not isAnon;
|
||||||
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
||||||
review_state python:wtool.getInfoFor(reply, 'review_state', 'none');
|
review_state python:wtool.getInfoFor(reply, 'review_state', 'none');
|
||||||
canEdit python:view.can_edit(reply);
|
canEdit python:view.can_edit(reply);
|
||||||
canDelete python:view.can_delete(reply)"
|
canDelete python:view.can_delete(reply)"
|
||||||
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
||||||
id string:${reply/getId}"
|
id string:${reply/getId}"
|
||||||
@ -92,9 +92,9 @@
|
|||||||
action=""
|
action=""
|
||||||
method="post"
|
method="post"
|
||||||
class="commentactionsform"
|
class="commentactionsform"
|
||||||
tal:condition="python:not canDelete and isDeleteOwnCommentAllowed and view.could_delete_own(reply)"
|
tal:condition="python:not canDelete and isDeleteOwnCommentAllowed and view.could_delete_own(reply)"
|
||||||
tal:attributes="action string:${reply/absolute_url}/@@delete-own-comment;
|
tal:attributes="action string:${reply/absolute_url}/@@delete-own-comment;
|
||||||
style python:view.can_delete_own(reply) and 'display: inline' or 'display: none'">
|
style python:view.can_delete_own(reply) and 'display: inline' or 'display: none'">
|
||||||
<input name="form.button.DeleteComment"
|
<input name="form.button.DeleteComment"
|
||||||
class="destructive"
|
class="destructive"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
@ -8,6 +8,7 @@ from Products.CMFCore.interfaces import IFolderish
|
|||||||
from Products.CMFCore.utils import getToolByName
|
from Products.CMFCore.utils import getToolByName
|
||||||
from Products.CMFPlone.interfaces import INonStructuralFolder
|
from Products.CMFPlone.interfaces import INonStructuralFolder
|
||||||
from Products.CMFPlone.interfaces import IPloneSiteRoot
|
from Products.CMFPlone.interfaces import IPloneSiteRoot
|
||||||
|
from Products.CMFPlone.utils import safe_hasattr
|
||||||
from zope.component import queryUtility
|
from zope.component import queryUtility
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +133,7 @@ class ConversationView(object):
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
# Check if discussion is allowed on the content object
|
# 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:
|
if context.allow_discussion is not None:
|
||||||
return context.allow_discussion
|
return context.allow_discussion
|
||||||
|
|
||||||
|
@ -189,14 +189,14 @@ require([ // jshint ignore:line
|
|||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Edit a comment
|
* Edit a comment
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
if($.fn.prepOverlay){
|
if($.fn.prepOverlay){
|
||||||
$('form[name="edit"]').prepOverlay({
|
$('form[name="edit"]').prepOverlay({
|
||||||
cssclass: 'overlay-edit-comment',
|
cssclass: 'overlay-edit-comment',
|
||||||
width: '60%',
|
width: '60%',
|
||||||
subtype: 'ajax',
|
subtype: 'ajax',
|
||||||
filter: '#content>*'
|
filter: '#content>*'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**********************************************************************
|
/**********************************************************************
|
||||||
* Delete a comment and its answers.
|
* Delete a comment and its answers.
|
||||||
|
@ -17,7 +17,8 @@ except ImportError:
|
|||||||
try:
|
try:
|
||||||
from plone.app.contentrules.handlers import execute
|
from plone.app.contentrules.handlers import execute
|
||||||
except ImportError:
|
except ImportError:
|
||||||
execute = lambda context, event: False
|
def execute(context, event):
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def execute_comment(event):
|
def execute_comment(event):
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<registry>
|
<registry>
|
||||||
<records interface="plone.app.discussion.interfaces.IDiscussionSettings">
|
<records interface="plone.app.discussion.interfaces.IDiscussionSettings">
|
||||||
<value key="edit_comment_enabled">False</value>
|
<value key="edit_comment_enabled">False</value>
|
||||||
<value key="delete_own_comment_enabled">False</value>
|
<value key="delete_own_comment_enabled">False</value>
|
||||||
</records>
|
</records>
|
||||||
</registry>
|
</registry>
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</permission>
|
</permission>
|
||||||
<permission name="Delete own comments" acquire="False">
|
<permission name="Delete own comments" acquire="False">
|
||||||
<role name="Manager"/>
|
<role name="Manager"/>
|
||||||
<role name="Site Administrator"/>
|
<role name="Site Administrator"/>
|
||||||
<role name="Reviewer"/>
|
<role name="Reviewer"/>
|
||||||
<role name="Owner"/>
|
<role name="Owner"/>
|
||||||
</permission>
|
</permission>
|
||||||
|
Loading…
Reference in New Issue
Block a user