Skip to content

Commit

Permalink
CM-403: add task logic to GroupIndividual update (#38)
Browse files Browse the repository at this point in the history
* CM-404: update handle change head

* CM-403: add task logic to GroupIndividual update

---------

Co-authored-by: Jan <[email protected]>
  • Loading branch information
jdolkowski and Jan authored Jan 5, 2024
1 parent c2ea919 commit f6000aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions individual/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"gql_group_update_perms": ["180003"],
"gql_group_delete_perms": ["180004"],
"gql_check_individual_update": True,
"gql_check_group_individual_update": True,
}


Expand All @@ -26,6 +27,7 @@ class IndividualConfig(AppConfig):
gql_group_update_perms = None
gql_group_delete_perms = None
gql_check_individual_update = None
gql_check_group_individual_update = None

def ready(self):
from core.models import ModuleConfiguration
Expand Down
5 changes: 4 additions & 1 deletion individual/gql_mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ def _mutate(cls, user, **data):
data.pop('client_mutation_label')

service = GroupIndividualService(user)
service.update(data)
if IndividualConfig.gql_check_group_individual_update:
service.create_update_task(data)
else:
service.update(data)

class Input(UpdateGroupIndividualInputType):
pass
Expand Down
2 changes: 1 addition & 1 deletion individual/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def update_group_individuals(self, obj_data):
return output_exception(model_name=self.OBJECT_TYPE.__name__, method="update", exception=exc)


class GroupIndividualService(BaseService):
class GroupIndividualService(BaseService, UpdateCheckerLogicServiceMixin):
OBJECT_TYPE = GroupIndividual

def __init__(self, user, validation_class=GroupIndividualValidation):
Expand Down

0 comments on commit f6000aa

Please sign in to comment.