https://pulp.plan.io/https://pulp.plan.io/favicon.ico2021-06-23T13:59:39ZPulpPulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=722582021-06-23T13:59:39Zdaviddavis
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/72258/diff?detail_id=72483">diff</a>)</li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=725582021-06-29T14:52:00Zdkliban@redhat.com
<ul><li><strong>Triaged</strong> changed from <i>No</i> to <i>Yes</i></li><li><strong>Sprint</strong> set to <i>Sprint 99</i></li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=727432021-07-02T19:23:24Zrchan
<ul><li><strong>Sprint</strong> changed from <i>Sprint 99</i> to <i>Sprint 100</i></li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=728822021-07-07T15:34:08Zlmjachky
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>lmjachky</i></li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=729932021-07-09T12:55:08Zlmjachky
<ul></ul><p>It looks like <code>rest_framework</code> does not support dictionary form input (<a href="https://github.com/encode/django-rest-framework/blob/71e6c30034a1dd35a39ca74f86c371713e762c79/rest_framework/templates/rest_framework/inline/dict_field.html#L8" class="external">https://github.com/encode/django-rest-framework/blob/71e6c30034a1dd35a39ca74f86c371713e762c79/rest_framework/templates/rest_framework/inline/dict_field.html#L8</a>) in the web UI. Furthermore, once the framework determines that a user passed data via an HTML form, it still tries to parse the data by searching for a regex match (<a href="https://github.com/encode/django-rest-framework/blob/71e6c30034a1dd35a39ca74f86c371713e762c79/rest_framework/utils/html.py#L69-L95" class="external">https://github.com/encode/django-rest-framework/blob/71e6c30034a1dd35a39ca74f86c371713e762c79/rest_framework/utils/html.py#L69-L95</a>). But, this approach will never find a match for <code>pulp_labels</code> because the method searches for keys like <code>pulp_labels.xyz</code>, in our case <code>pulp_labels.environment</code>. Such a key is considered always invalid:</p>
<pre><code>{
"pulp_labels.environment": [
"Unexpected field"
]
}
</code></pre>
<p>The solution is to replace <code>DictField</code> (<a href="https://github.com/pulp/pulpcore/blob/3ca47373e4a33965da362e76bc269640f8dc6925/pulpcore/app/serializers/fields.py#L380" class="external">https://github.com/pulp/pulpcore/blob/3ca47373e4a33965da362e76bc269640f8dc6925/pulpcore/app/serializers/fields.py#L380</a>) with <code>JSONField</code>.</p> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=729942021-07-09T13:46:28Zpulpbot
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p>PR: <a href="https://github.com/pulp/pulpcore/pull/1474" class="external">https://github.com/pulp/pulpcore/pull/1474</a></p> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=730202021-07-10T04:21:19Zdalleydalley@redhat.com
<ul><li><strong>Related to</strong> <i><a class="issue tracker-7 status-11 priority-6 priority-default closed" href="/issues/9058">Backport #9058</a>: Backport 8954 "using form data doesn't set labels" to 3.14.z</i> added</li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=730292021-07-10T04:23:12Zdalleydalley@redhat.com
<ul><li><strong>Sprint/Milestone</strong> set to <i>3.14.2</i></li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=730512021-07-12T19:34:20ZAnonymous
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li></ul><p>Applied in changeset <a class="changeset" title="Replace DictField with JSONField closes #8954" href="https://pulp.plan.io/projects/pulp/repository/pulpcore/revisions/3bc707ad6aab45d76f06abab7ed0870049cc28f8">pulpcore|3bc707ad6aab45d76f06abab7ed0870049cc28f8</a>.</p> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=731332021-07-13T15:16:59Zipanova@redhat.comipanova@redhat.com
<ul><li><strong>Sprint/Milestone</strong> changed from <i>3.14.2</i> to <i>3.15.0</i></li></ul> Pulp - Issue #8954: Using form data doesn't set labelshttps://pulp.plan.io/issues/8954?journal_id=748672021-08-26T12:35:49Zpulpbot
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul>