diff --git a/passhportd/app/models_mod/targetgroup.py b/passhportd/app/models_mod/targetgroup.py index 2a34cd86..429af200 100644 --- a/passhportd/app/models_mod/targetgroup.py +++ b/passhportd/app/models_mod/targetgroup.py @@ -79,7 +79,7 @@ def simplejson(self): output = "{\n" output = output + "\"Name\": \"" + format(self.name) + "\",\n" - output = output + "\"Comment\": \"" + format(self.comment) + "\",\n" + output = output + "\"Comment\": \"" + format(self.comment) + "\"\n" output = output + "}" return output @@ -109,7 +109,7 @@ def prepare_delete(self): self.tgadmins.pop() return self - + # User management def is_members(self, user): @@ -288,7 +288,7 @@ def accessible_target_list(self, parsed_targetgroups = None, style="object"): style = "object"): if target not in targets: targets.append(target) - # Return target objects or names depending of the style + # Return target objects or names depending of the style if style == "names": targetnames = [] for target in targets: @@ -386,7 +386,7 @@ def addtargetgroup(self, targetgroup): """Add a targetgroup to the relaton table""" if not self.is_tgmembers(targetgroup) and not self == targetgroup: self.tgmembers.append(targetgroup) - else: + else: return False return self @@ -410,7 +410,7 @@ def memberof(self, obj): members.append(targetgroup) else: return "Error in object type" - + ret = "[" for m in members: ret = ret + m.name + "," @@ -456,11 +456,11 @@ def all_targetgroupname_list(self, parsed_targetgroups = None): return targetgroupnames def show_targets(self, indentation): - """Return a formated list of the targets that the targetgroup + """Return a formated list of the targets that the targetgroup provides """ listing = [] - + indent = "" for i in range(indentation): indent = indent + " " diff --git a/passhportd/app/models_mod/user.py b/passhportd/app/models_mod/user.py index 179e9c74..38e74818 100644 --- a/passhportd/app/models_mod/user.py +++ b/passhportd/app/models_mod/user.py @@ -66,7 +66,7 @@ def simplejson(self): format(self.show_sshkeyhash()) + "\",\n" output = output + "\"logfilesize\": \"" + \ format(self.show_logfilesize()) + "\",\n" - output = output + "\"comment\": \"" + format(self.comment) + "\",\n" + output = output + "\"comment\": \"" + format(self.comment) + "\"\n" output = output + "}" return output diff --git a/passhportd/app/models_mod/usergroup.py b/passhportd/app/models_mod/usergroup.py index 22a58c62..220a4f51 100644 --- a/passhportd/app/models_mod/usergroup.py +++ b/passhportd/app/models_mod/usergroup.py @@ -71,7 +71,7 @@ def simplejson(self): output = output + "\"Name\": \"" + format(self.name) + "\",\n" output = output + "\"Comment\": \"" + format(self.comment) + "\",\n" output = output + "\"Directsize\": \"" + format(str(directsize)) + "\",\n" - output = output + "\"Totalsize\": \"" + format(str(totalsize)) + "\",\n" + output = output + "\"Totalsize\": \"" + format(str(totalsize)) + "\"\n" output = output + "}" return output @@ -80,7 +80,7 @@ def simplejson(self): def show_name(self): """Return a string containing the usergroup's name""" return self.name - + def show_comment(self): """Return a string containing the usergroup's comment""" @@ -189,7 +189,7 @@ def all_username_list(self, parsed_usergroups = []): """ usernames = self.username_list() - # Recursive on groups: + # Recursive on groups: # we list all usernames but we never parse a group twice # to avoid cirular issues. for usergroup in self.gmembers: @@ -217,7 +217,7 @@ def memberof(self, obj): members.append(usergroup) else: return "Error in object type" - + ret = "[" for m in members: ret = ret + m.name + "," @@ -278,7 +278,7 @@ def all_usergroupname_list(self, parsed_usergroups = []): in the usergroup """ usergroupnames = self.usergroupname_list() # ["G1","G2"] - + # Recursive on usergroups: # we list all usergroups but we never parse a group twice # to avoid cirular issues. @@ -356,7 +356,7 @@ def accessible_target_list(self, checked_usergroups = [], mode="string"): checked_usergroups.append(usergroup) for target in usergroup.accessible_target_list(checked_usergroups): if target not in self.targets: - if mode == "string": + if mode == "string": accessible_targets.append(target.name) else: accessible_targets.append(target) @@ -377,7 +377,7 @@ def show_targets(self, indentation): """Return all targets the group gives access First the targets with this group attached Then targets from targetgroups with this group attached - Then targets from groups with this group attached + Then targets from groups with this group attached Finally We relaunch this on the groups with this groups attached """ listing = []