Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Models and signup & login views for consumer_user_poc #155
base: master
Are you sure you want to change the base?
Models and signup & login views for consumer_user_poc #155
Changes from 21 commits
70c3abd
24660a8
ca0ff9c
a2a4655
8f921e9
4eab216
9259888
2e55a11
bd1bc56
05ff960
71f200d
b6e3f86
3a48c03
5b161a9
4132c62
6a43641
1623156
33f8433
34b58ad
f8de41f
6c47746
aff9346
d90710e
08d3e08
fce58b3
143bb10
08fb9e1
8706645
e60c146
0e593cd
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to add an extra check here
Otherwise you'll end up with an infinite loop.
Once you fix that, you'll see there is still a failing test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made the change inside the method. If we keep it at top when the case is closed it wont update the corresponding invitation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how I didn't catch this before, but this is the wrong case_id. From the spec, this should be the "uuid for the patient/demographic case."
It would be something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only save case_id, domain in both ConsumerUserInvitation and ConsumerUserCaseRelationship models as mentioned in the document. You want me to store uuid for the patient/demographic case in the case_id right. I tried implementing the above logic but getting host_indices as empty list when I call from tests using create_case. I tried looking at other usages but could n't find anything helpful. Can you share here how to use this correctly?
Also, Since we are now planning to use uuid for the patient/demographic case in the case_id, will update_case work with this reference_id? Should I add a new column in both ConsumerUserInvitation and ConsumerUserCaseRelationship models to store case_id too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can create indexed cases like this:
https://github.com/challabeehyv/commcare-hq/blob/consumer_user_poc/corehq/ex-submodules/casexml/apps/case/tests/test_db_accessors.py#L178-L186
So you would need to make both a demographic, and an invitation case in your tests.
We want the CaseRelationship to link to the demographic case, and we would want to store that id on the invitation when it is created to stop a case getting reassigned between the invitation being created and being accepted.
I think if there can only be a single invitation case open for a particular demographic case, we should be able to always get the invitation back (by looking at the reverse indexed cases for one with the invitation type).
However, I agree that it might be better to store both invitation case_id and the demographic case_id on the
ConsumerUserInvitation
. I don't think you need to add this to theConsumerUserCaseRelationship
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI I get this error when running this in celery:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its working in my local system when I trigger the call directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked if I missed anything while pushing. I pushed all the changes I made. Can you tell me how are you triggering this task? I will try to replicate in my system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Weird, I was testing by creating a case through an app I built locally. I will try again and see if there is anything with my local setup that was causing this.