-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Fix assets submission count missing with 'view_submissions' of project views #4225
Fix assets submission count missing with 'view_submissions' of project views #4225
Conversation
and rename 'change_metadata' to 'change_metadata_asset' for consistency with DRF
cdcc23b
to
3bf29be
Compare
46eeff7
to
dc61565
Compare
Add NLP to service usage API
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.
@noliveleger good to go after adding the test we discussed!
…com:kobotoolbox/kpi into fix-submission-counts-with-view-submissions
…e' and 'settings'
ff12597
to
3a3f134
Compare
kpi/tests/api/v2/test_api_assets.py
Outdated
assert self._sorted_dict(asset_data['summary']) == self._sorted_dict( | ||
asset_data['summary'] | ||
) | ||
assert self._sorted_dict(asset_data['content']) == self._sorted_dict( | ||
asset_data['content'] | ||
) |
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.
@noliveleger these are like assert x == x
are they not? 🧐 Reformatted:
assert self._sorted_dict(asset_data['summary'])
== self._sorted_dict(asset_data['summary'])
assert self._sorted_dict(asset_data['content'])
== self._sorted_dict(asset_data['content'])
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.
Oops :-P Indeed. Not what I wanted to do.
That's how you make tests pass no matter what :-P
Checklist
Description
Returns the correct number instead of 0
Related issue
Close #4194
Additional info
asset.has_perm(user, permission)
returnsTrue
ifuser
belongs to a project view that haspermission
selected forasset
. Previous behaviour wasFalse
.change_metadata
permission has been renamechange_metadata_asset
to be consistent with other permissions.