From 3e604e9d6881eff83d939ce8eb7e7d73ec9fb15c Mon Sep 17 00:00:00 2001 From: Aguay-val Date: Thu, 27 Jun 2019 16:22:05 +0200 Subject: [PATCH 1/3] fix(models_mod/user.py): Fix simplejson def --- passhportd/app/models_mod/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From ec32b6b52931fd819dd5a7fd104f641eaff5552c Mon Sep 17 00:00:00 2001 From: Aguay-val Date: Thu, 27 Jun 2019 16:41:14 +0200 Subject: [PATCH 2/3] fix(models_mod/usergroup.py): Fix simplejson def --- passhportd/app/models_mod/usergroup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 = [] From 427da23a318b4c0ad024ddac28d4a53765f8dab6 Mon Sep 17 00:00:00 2001 From: Aguay-val Date: Thu, 27 Jun 2019 16:41:32 +0200 Subject: [PATCH 3/3] fix(models_mod/targetgroup.py): Fix simplejson def --- passhportd/app/models_mod/targetgroup.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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 + " "