Skip to content

Commit

Permalink
pep8 cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
jone committed Sep 4, 2015
1 parent f5872b5 commit fbed015
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
5 changes: 3 additions & 2 deletions ftw/usermanagement/browser/base_listing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from zope.interface import implements
from ftw.tabbedview.interfaces import INoExtJS


class BaseListing(ListingView):
"""BaseListing View for a tab in the tabbedview"""

Expand All @@ -23,8 +24,8 @@ def validate_base_query(self, query):
"""Validates and fixes the base query. Returns the query object.
"""
if not isinstance(query, dict):
raise ValueError('Expected a dict from get_base_query() of ' + \
str(self.config))
raise ValueError('Expected a dict from get_base_query() of ' +
str(self.config))

return query

Expand Down
22 changes: 14 additions & 8 deletions ftw/usermanagement/browser/tabbed_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,19 @@ def get_tabs(self):
"""Returns a list of dicts containing the tabs definitions"""

translate = self.context.translate
return [{'id':'users_management', 'class':'',
return [
{
'id': 'users_management',
'class': '',
'description': translate(
_(
'msg_usersDescription',
default='Users-management')), },
{'id':'groups_management', 'class':'',
_('msg_usersDescription',
default='Users-management')),
},

{
'id': 'groups_management',
'class': '',
'description': translate(
_(
'msg_groupsDescription',
default='Groups-management')), }, ]
_('msg_groupsDescription',
default='Groups-management')),
}]
13 changes: 7 additions & 6 deletions ftw/usermanagement/browser/user/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, context, request):

@property
def columns(self):
base_columns = (
base_columns = (
{'column': 'counter',
'column_title': _(u'label_nr', default='Nr.'),
},
Expand All @@ -77,6 +77,7 @@ def is_email_login(self):
prop_tool = getToolByName(self.context, 'portal_properties')
return prop_tool.site_properties.getProperty('use_email_as_login')


class UsersTableSource(BaseManagementTableSource):

def search_results(self, query):
Expand Down Expand Up @@ -136,8 +137,8 @@ def get_results(self):
# we continue with the next user
continue

#We need to use the login name to get the group because a plone function
# is decleared wrong
# We need to use the login name to get the group because a plone
# function is decleared wrong
if self.is_email_login:
users_map.append(dict(
counter=i + 1,
Expand Down Expand Up @@ -233,8 +234,8 @@ def _should_load_userdata(self, position):
# If we have nothing in the filter and the item is in the visible
# area of the batch, then we load the userdata
if not self.query.get('filter_text', '') and \
(not self.query['batching'] or \
(position >= self.batch_start and position < self.batch_end)):
(not self.query['batching'] or (
position >= self.batch_start and position < self.batch_end)):
return True

# If we have anything in the textfilter, we have to load the
Expand All @@ -255,7 +256,7 @@ def _get_group_objects_of_user(self, loginname):
""" Return all groupobjects of a given user
"""

#This Function requires the login name and not the userid
# This Function requires the login name and not the userid
groups = self.gtool.getGroupsByUserId(loginname)

groups = self._cleanup_groups(groups)
Expand Down

0 comments on commit fbed015

Please sign in to comment.