Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't used builtins as variable names (type)

  • Loading branch information...
commit ac71bcdc47ac83ddf2ea3cf0e9ff1e1e9f3df1b2 1 parent df07c0d
@stefanfoulis authored
View
4 filer/models/filemodels.py
@@ -183,7 +183,7 @@ def has_read_permission(self, request):
def has_add_children_permission(self, request):
return self.has_generic_permission(request, 'add_children')
- def has_generic_permission(self, request, type):
+ def has_generic_permission(self, request, permission_type):
"""
Return true if the current user has permission on this
image. Return the string 'ALL' if the user has all rights.
@@ -196,7 +196,7 @@ def has_generic_permission(self, request, type):
elif user == self.owner:
return True
elif self.folder:
- return self.folder.has_generic_permission(request, type)
+ return self.folder.has_generic_permission(request, permission_type)
else:
return False
View
14 filer/models/foldermodels.py
@@ -152,7 +152,7 @@ def has_read_permission(self, request):
def has_add_children_permission(self, request):
return self.has_generic_permission(request, 'add_children')
- def has_generic_permission(self, request, type):
+ def has_generic_permission(self, request, permission_type):
"""
Return true if the current user has permission on this
folder. Return the string 'ALL' if the user has all rights.
@@ -165,8 +165,8 @@ def has_generic_permission(self, request, type):
elif user == self.owner:
return True
else:
- if not hasattr(self, "permission_cache") or \
- type not in self.permission_cache or \
+ if not hasattr(self, "permission_cache") or\
+ permission_type not in self.permission_cache or \
request.user.pk != self.permission_cache['user'].pk:
if not hasattr(self, "permission_cache") or request.user.pk != self.permission_cache['user'].pk:
self.permission_cache = {
@@ -175,16 +175,16 @@ def has_generic_permission(self, request, type):
# This calls methods on the manager i.e. get_read_id_list()
func = getattr(FolderPermission.objects,
- "get_%s_id_list" % type)
+ "get_%s_id_list" % permission_type)
permission = func(user)
if permission == "All":
- self.permission_cache[type] = True
+ self.permission_cache[permission_type] = True
self.permission_cache['read'] = True
self.permission_cache['edit'] = True
self.permission_cache['add_children'] = True
else:
- self.permission_cache[type] = self.id in permission
- return self.permission_cache[type]
+ self.permission_cache[permission_type] = self.id in permission
+ return self.permission_cache[permission_type]
def get_admin_url_path(self):
return urlresolvers.reverse('admin:filer_folder_change',
View
4 filer/models/imagemodels.py
@@ -116,7 +116,7 @@ def has_read_permission(self, request):
def has_add_children_permission(self, request):
return self.has_generic_permission(request, 'add_children')
- def has_generic_permission(self, request, type):
+ def has_generic_permission(self, request, permission_type):
"""
Return true if the current user has permission on this
image. Return the string 'ALL' if the user has all rights.
@@ -129,7 +129,7 @@ def has_generic_permission(self, request, type):
elif user == self.owner:
return True
elif self.folder:
- return self.folder.has_generic_permission(request, type)
+ return self.folder.has_generic_permission(request, permission_type)
else:
return False
Please sign in to comment.
Something went wrong with that request. Please try again.