-
Notifications
You must be signed in to change notification settings - Fork 133
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
Project Viewset: Caching refactor #1902
Conversation
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.
Looks good!
""" | ||
Clears and sets project cache | ||
""" | ||
from onadata.libs.serializers.project_serializer import ProjectSerializer |
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 going to assume we had to import here because of cyclic import error, no?
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.
Yes, this is here to avoid a cyclic import error
In some cases publish_form returns a dict containing an error message as such we should only reset the project cache when an XForm is returned
a053821
to
c71a3b5
Compare
c71a3b5
to
90f2c19
Compare
The Project viewset cache should be cleared if one of it's XForms or Submissions have had an update to their data so that stale responses are not returned
90f2c19
to
cbc56e1
Compare
Here is an overview of what got changed by this pull request: Clones added
============
- onadata/apps/api/tests/viewsets/test_project_viewset.py 6
See the complete overview on Codacy |
Changes / Features implemented
num_datasets
value of a project was not updated when a form that used to belong to that form is transferredreset_project_cache
utility functionSteps taken to verify this change does what is intended
Side effects of implementing this change
Closes #1903