Skip to content

Commit

Permalink
CM-398: add logic to creata task on individual update
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan committed Dec 27, 2023
1 parent 49b1188 commit f8ad137
Show file tree
Hide file tree
Showing 3 changed files with 8 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 @@ -9,6 +9,7 @@
"gql_group_create_perms": ["180002"],
"gql_group_update_perms": ["180003"],
"gql_group_delete_perms": ["180004"],
"gql_check_individual_update": True,
}


Expand All @@ -24,6 +25,7 @@ class IndividualConfig(AppConfig):
gql_group_create_perms = None
gql_group_update_perms = None
gql_group_delete_perms = None
gql_check_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 @@ -92,7 +92,10 @@ def _mutate(cls, user, **data):
data.pop('client_mutation_label')

service = IndividualService(user)
service.update(data)
if IndividualConfig.gql_check_individual_update:
service.create_update_task(data)
else:
service.update(data)

class Input(UpdateIndividualInputType):
pass
Expand Down
3 changes: 2 additions & 1 deletion individual/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@
GroupValidation
from core.services.utils import check_authentication as check_authentication, output_exception, output_result_success, \
model_representation
from tasks_management.services import UpdateCheckerLogicServiceMixin

logger = logging.getLogger(__name__)


class IndividualService(BaseService):
class IndividualService(BaseService, UpdateCheckerLogicServiceMixin):
@register_service_signal('individual_service.create')
def create(self, obj_data):
return super().create(obj_data)
Expand Down

0 comments on commit f8ad137

Please sign in to comment.