Skip to content

Commit

Permalink
Nailgun Updates for Needs_publish feature (#922)
Browse files Browse the repository at this point in the history
* Add needs_publish flag

* Fix ContentViewComponent add method

* Readd payload mixin
  • Loading branch information
sambible committed Jun 28, 2023
1 parent 33db04b commit 46e937b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/test_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit 46e937b

Please sign in to comment.