nsarchive 3.0.0a6__tar.gz → 3.0.0a7__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nsarchive
3
- Version: 3.0.0a6
3
+ Version: 3.0.0a7
4
4
  Summary: API-wrapper pour récupérer des données liées à Nation
5
5
  License: GPL-3.0
6
6
  Author: happex
@@ -1,7 +1,7 @@
1
1
  """
2
2
  nsarchive - API-wrapper pour récupérer des données liées à Nation.
3
3
 
4
- Version: 3.0.0a6
4
+ Version: 3.0.0a7
5
5
  License: GPL-3.0
6
6
  Auteur : happex <110610727+okayhappex@users.noreply.github.com>
7
7
 
@@ -92,11 +92,23 @@ class EntityInstance(Instance):
92
92
  return entity
93
93
 
94
94
  def get_entity_groups(self, entity: User) -> list[Organization]:
95
- print(entity._url)
96
95
  res = requests.get(f"{entity._url}/groups", headers = self.default_headers)
97
96
 
98
97
  if res.status_code == 200:
99
- return res.json()
98
+ data = res.json()
99
+ groups = []
100
+
101
+ for grp in data:
102
+ if grp is None: continue
103
+
104
+ group = Organization(grp["id"])
105
+ group._url = f"{self.url}/model/organizations/{grp['id']}"
106
+
107
+ group._load(grp)
108
+
109
+ groups.append(group)
110
+
111
+ return groups
100
112
  else:
101
113
  res.raise_for_status()
102
114
  return []
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nsarchive"
3
- version = "3.0.0a6"
3
+ version = "3.0.0a7"
4
4
  description = "API-wrapper pour récupérer des données liées à Nation"
5
5
  authors = ["happex <110610727+okayhappex@users.noreply.github.com>"]
6
6
  license = "GPL-3.0"
File without changes
File without changes