Skip to content

Commit

Permalink
Merge pull request #33 from openimis/fix/OP-938
Browse files Browse the repository at this point in the history
frontend and GQL type use uuid instead of policyUuid
  • Loading branch information
delcroip authored Nov 10, 2022
2 parents 7efcc7e + 0454ba0 commit 24d1364
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions policy/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, user):

@register_service_signal('policy_service.create_or_update')
def update_or_create(self, data, user):
policy_uuid = data.get('policy_uuid', None)
policy_uuid = data.get('uuid', None)
if policy_uuid:
return self.update_policy(data, user)
else:
Expand All @@ -50,7 +50,7 @@ def update_or_create(self, data, user):
@register_service_signal('policy_service.update')
def update_policy(self, data, user):
data = self._clean_mutation_info(data)
policy_uuid = data.pop('policy_uuid') if 'policy_uuid' in data else None
policy_uuid = data.pop('uuid') if 'uuid' in data else None
policy = Policy.objects.get(uuid=policy_uuid)
policy.save_history()
reset_policy_before_update(policy)
Expand Down

0 comments on commit 24d1364

Please sign in to comment.