From 46e937b6900985085155e85324c06f96b5ce9115 Mon Sep 17 00:00:00 2001 From: Samuel Bible Date: Wed, 28 Jun 2023 07:42:48 -0500 Subject: [PATCH] Nailgun Updates for Needs_publish feature (#922) * Add needs_publish flag * Fix ContentViewComponent add method * Readd payload mixin --- nailgun/entities.py | 3 +-- tests/test_entities.py | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nailgun/entities.py b/nailgun/entities.py index 714712ca..c1651b62 100644 --- a/nailgun/entities.py +++ b/nailgun/entities.py @@ -2655,6 +2655,7 @@ def __init__(self, server_config=None, **kwargs): 'name': entity_fields.StringField( required=True, str_type='alpha', length=(6, 12), unique=True ), + 'needs_publish': entity_fields.BooleanField(), 'next_version': entity_fields.IntegerField(), 'organization': entity_fields.OneToOneField( Organization, @@ -2892,8 +2893,6 @@ def add(self, synchronous=True, timeout=None, **kwargs): if 'data' not in kwargs: # data is required kwargs['data'] = dict() - if 'component_ids' not in kwargs['data']: - kwargs['data']['components'] = [_payload(self.get_fields(), self.get_values())] kwargs.update(self._server_config.get_client_kwargs()) response = client.put(self.path('add'), **kwargs) return _handle_response(response, self._server_config, synchronous, timeout) diff --git a/tests/test_entities.py b/tests/test_entities.py index aa655c9a..0707be3a 100644 --- a/tests/test_entities.py +++ b/tests/test_entities.py @@ -2550,6 +2550,7 @@ def setUp(self): "label": "my_CV", "last_published": '2018-11-23 11:51:30 UTC', "name": "my CV", + "needs_publish": True, "next_version": "3.0", "organization_id": 1, "repositories": [