-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add endpoint to stream document on organisation #1809
Add endpoint to stream document on organisation #1809
Conversation
5f0bb3c
to
ddb0799
Compare
@@ -1078,6 +1079,23 @@ def add_users(self, count=3): | |||
out.append(user) | |||
return out | |||
|
|||
def create_default_bucket(self): |
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.
probably silly question but this is to create our bucket locally MIMO type for testing ?
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. It creates a bucket that is for the tests.
If you look at the test case that I've added it uses the mock_aws
which is using an in-memory mock of S3 so this isn't testing any external buckets.
|
||
|
||
class DocumentOnOrganisationStreamView(RetrieveAPIView): | ||
authentication_classes = (SharedAuthentication,) |
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.
as a precaution when user is an exporter is it worth checking they're part of the organisation.
I don't think we doing these kind of checked but wondering if it's worth introducing these checks
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.
oh we do have a OrganisationAuthentication
to do just that
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.
Done. OrganisationAuthentication
isn't the fix for that.
ddb0799
to
9920abd
Compare
…tion
9920abd
to
af00f54
Compare
def retrieve(self, request, pk, document_on_application_pk): | ||
instance = get_object_or_404(self.get_queryset(), pk=document_on_application_pk) | ||
instance = self.get_object() | ||
serializer = self.serializer_class(instance) | ||
return JsonResponse(serializer.data) |
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.
with the instance = self.get_object()
change this is pretty much the same as method in base class RetrieveModelMixin
, so is this required?
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.
oh we need JsonResponse
which is different.
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 actually remove def retrieve
I did that very thing but then thought it might confuse people as to why all the others have been overridden and this one wasn't. I just imagined a PR review saying "why did you remove this method".
b8cac6f
to
aa7dfcb
Compare
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.
lgtm
a338054
to
9caf6ac
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #1809 +/- ##
===========================================
+ Coverage 60.54% 90.15% +29.60%
===========================================
Files 317 320 +3
Lines 17694 17764 +70
Branches 2260 2263 +3
===========================================
+ Hits 10713 16015 +5302
+ Misses 6579 1248 -5331
- Partials 402 501 +99 ☔ View full report in Codecov by Sentry. |
Aim
Add endpoint to stream document on organisation
LTD-4672