Various flake8 fixes.
- Removed tabs. - Fixed E731 do not assign a lambda expression, use a def. - avoid hasattr
This commit is contained in:
committed by
Gil Forcada
parent
cdb48ba87a
commit
814af8d837
@@ -37,8 +37,8 @@
|
||||
author_home_url python:view.get_commenter_home_url(username=reply.author_username);
|
||||
has_author_link python:author_home_url and not isAnon;
|
||||
portrait_url python:view.get_commenter_portrait(reply.author_username);
|
||||
review_state python:wtool.getInfoFor(reply, 'review_state', 'none');
|
||||
canEdit python:view.can_edit(reply);
|
||||
review_state python:wtool.getInfoFor(reply, 'review_state', 'none');
|
||||
canEdit python:view.can_edit(reply);
|
||||
canDelete python:view.can_delete(reply)"
|
||||
tal:attributes="class python:'comment replyTreeLevel'+str(depth)+' state-'+str(review_state);
|
||||
id string:${reply/getId}"
|
||||
@@ -92,9 +92,9 @@
|
||||
action=""
|
||||
method="post"
|
||||
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;
|
||||
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"
|
||||
class="destructive"
|
||||
type="submit"
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -189,14 +189,14 @@ require([ // jshint ignore:line
|
||||
/**********************************************************************
|
||||
* Edit a comment
|
||||
**********************************************************************/
|
||||
if($.fn.prepOverlay){
|
||||
$('form[name="edit"]').prepOverlay({
|
||||
cssclass: 'overlay-edit-comment',
|
||||
width: '60%',
|
||||
subtype: 'ajax',
|
||||
filter: '#content>*'
|
||||
});
|
||||
}
|
||||
if($.fn.prepOverlay){
|
||||
$('form[name="edit"]').prepOverlay({
|
||||
cssclass: 'overlay-edit-comment',
|
||||
width: '60%',
|
||||
subtype: 'ajax',
|
||||
filter: '#content>*'
|
||||
});
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* Delete a comment and its answers.
|
||||
|
||||
Reference in New Issue
Block a user