-
Notifications
You must be signed in to change notification settings - Fork 168
Problem: identity fields are serialized as full URLs #3607
Conversation
Hello @dkliban! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on September 04, 2018 at 13:46 Hours UTC |
bb392c0
to
0c999ec
Compare
Codecov Report
@@ Coverage Diff @@
## master #3607 +/- ##
==========================================
- Coverage 56.79% 56.73% -0.07%
==========================================
Files 60 60
Lines 2590 2607 +17
==========================================
+ Hits 1471 1479 +8
- Misses 1119 1128 +9
Continue to review full report at Codecov.
|
0c999ec
to
a828e6b
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.
While testing I see the worker url is still using a full URL. Here is a snipppet from the task status result:
"worker": "http://localhost:8000/pulp/api/v3/workers/2/",
a828e6b
to
8fc31d2
Compare
I updated the task serializer. |
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.
In the 'task' progress report I see a full url:
{
"message": "Downloading Metadata",
"state": "completed",
"total": 1,
"done": 1,
"suffix": "",
"task": "http://localhost:8000/pulp/api/v3/tasks/00429392-009b-4a18-a3e8-20709a15f7ed/"
},
8fc31d2
to
ee8d93c
Compare
Solution: stop passing request to the serializer so it can only form relative URLs This patch modifies the behavior of DetailIdentityField and it also adds an additional ItentityField RelatedField NestedRelatedField NestedIdentityField to replace HyperlinkIdentityField HyperlinkRelatedField NestedHyperlinkedIdentityField NestedHyperlinkedRelatedField provided by DRF and DRF nested. Required PR: pulp/pulp_file#114 re: pulp#3850 https://pulp.plan.io/issues/3850
ee8d93c
to
1099266
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.
@dkliban I tested this entirely just now also with PR 144 in pulp_file, and it all looks exactly correct. I tested it using your instructions. I also inspected all objects in the API looking for any stray full urls, but I found none.
Thank you for putting together this great work!
Solution: stop passing request to the serializer so it can only form relative URLs
This patch modifies the behavior of DetailIdentityField and it also adds an
additional
ItentityField
RelatedField
NestedRelatedField
NestedIdentityField
to replace
HyperlinkIdentityField
HyperlinkRelatedField
NestedHyperlinkedIdentityField
NestedHyperlinkedRelatedField
provided by DRF and DRF nested.
Required PR: pulp/pulp_file#114
re: #3850
https://pulp.plan.io/issues/3850