Skip to content

Commit

Permalink
Removed base_rest dependencies from apis. Changed to fastapi.
Browse files Browse the repository at this point in the history
Signed-off-by: Lalith Kota <[email protected]>
  • Loading branch information
lalithkota committed Apr 1, 2024
1 parent b7bc9cd commit 3259ac1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 18 deletions.
2 changes: 1 addition & 1 deletion g2p_registry_membership/models/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def recompute_indicators_for_batch(self, offset, limit, recomputed_fields=None):

def recompute_indicators(self, recomputed_fields=None):
if recomputed_fields is not None and len(recomputed_fields) > 0:
if type(recomputed_fields[0]) is str:
if isinstance(recomputed_fields[0], str):
recomputed_fields = self._get_calculated_group_fields(recomputed_fields)
else:
recomputed_fields = self._get_calculated_group_fields()
Expand Down
3 changes: 2 additions & 1 deletion g2p_registry_membership/models/group_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def _kind_onchange(self):
for m in kind_id:
if m.isdigit():
# Only get the digit part of the string kind id
# Newly added kinds has Neworigin prefix so this is used to remove that
# Newly added kinds has Neworigin prefix so this
# is used to remove that
kind_str = kind_str + m

# If the rec_line which is the kind id is the same with the unique kind
Expand Down
9 changes: 6 additions & 3 deletions g2p_registry_membership/tests/test_membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ def test_03_disabled_individual(self):
self.assertEqual(self.registrant_3.disabled, curr_date, "Error disabling an individual!")

_logger.info(
f"Test 3: Modify disabled individual: {self.registrant_3.name} information. {self.registrant_3.disabled}"
f"Test 3: Modify disabled individual: {self.registrant_3.name} information. "
f"{self.registrant_3.disabled}"
)
self.registrant_3.update(
{
Expand Down Expand Up @@ -161,14 +162,16 @@ def test_04_individual_with_ended_membership(self):

grp_rec = self.group_1.group_membership_ids[0]
_logger.info(
f"Test 4: End membership of individual: {grp_rec.individual.name} membership with group: {grp_rec.group.name}."
f"Test 4: End membership of individual: {grp_rec.individual.name} membership with "
f"group: {grp_rec.group.name}."
)
curr_date = fields.Datetime.now()
grp_rec.update({"ended_date": curr_date})
self.assertEqual(grp_rec.is_ended, True, "Error ending the individual's membership to group!")

_logger.info(
f"Test 4: Modify individual with ended membership: {grp_rec.individual.name} information. {grp_rec.is_ended}"
f"Test 4: Modify individual with ended membership: {grp_rec.individual.name} information. "
f"{grp_rec.is_ended}"
)
grp_rec.individual.update(
{
Expand Down
14 changes: 4 additions & 10 deletions g2p_registry_rest_api/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,13 @@
"license": "Other OSI approved licence",
"development_status": "Alpha",
"depends": [
"base",
"mail",
"contacts",
"component",
"base_rest",
"pydantic",
"base_rest_pydantic",
"extendable",
"g2p_registry_base",
"g2p_registry_group",
"g2p_registry_individual",
"base_rest_auth_user_service",
"fastapi",
"extendable_fastapi",
],
"external_dependencies": {"python": ["extendable-pydantic"]},
"external_dependencies": {"python": ["extendable-pydantic", "pydantic"]},
"data": [
"security/g2p_security.xml",
"security/ir.model.access.csv",
Expand Down
3 changes: 1 addition & 2 deletions g2p_registry_rest_api_extension_demo/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
"license": "Other OSI approved licence",
"development_status": "Alpha",
"depends": [
"base",
"g2p_registry_rest_api",
],
"external_dependencies": {"python": ["extendable-pydantic", "pydantic==1.10.10"]},
"external_dependencies": {"python": ["extendable-pydantic", "pydantic"]},
"data": [],
"assets": {},
"demo": [],
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# generated from manifests external_dependencies
extendable-pydantic
pydantic==1.10.10
pydantic
schwifty

0 comments on commit 3259ac1

Please sign in to comment.