Skip to content

Commit

Permalink
Improvements required by claim sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
dborowiecki committed May 23, 2024
1 parent 45bae42 commit 47a10ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions claim/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,10 +663,10 @@ def set_claims_status(uuids, field, status, audit_data=None, user=None):
elif hasattr(exc, 'args') and len(exc.args):
for m in exc.args:
errors.append({'message': m })
if len(remaining_uuid):
errors.append(_(
"claim.validation.id_does_not_exist") % {'id': ','.join(remaining_uuid)})
if len(remaining_uuid):
errors.append(_(
"claim.validation.id_does_not_exist") % {'id': ','.join(remaining_uuid)})

return errors


Expand Down Expand Up @@ -721,6 +721,9 @@ def set_feedback_prompt_validity_to_to_current_date(claim_uuid):

def update_claims_dedrems(uuids, user):
# We could do it in one query with filter(claim__uuid__in=uuids) but we'd loose the logging
if not uuids:
# Additional check, empty uuids results in transaction error if uuids are queryset of uuids.
return []
errors = []
claims = Claim.objects.filter(uuid__in=uuids)
remaining_uuid = list(map(str.upper,uuids))
Expand Down
1 change: 1 addition & 0 deletions claim/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class DummyContext:
""" Just because we need a context to generate. """
user: User


class ClaimGraphQLTestCase(GraphQLTestCase):
GRAPHQL_URL = f'/{settings.SITE_ROOT()}graphql'
# This is required by some version of graphene but is never used. It should be set to the schema but the import
Expand Down

0 comments on commit 47a10ee

Please sign in to comment.