Skip to content

Commit

Permalink
fix for ContentView server_config auth values (#864)
Browse files Browse the repository at this point in the history
(cherry picked from commit 6d60091)
  • Loading branch information
vijaysawant authored and web-flow committed Jan 16, 2023
1 parent d25bc95 commit 2677667
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2489,6 +2489,15 @@ def read(self, entity=None, attrs=None, ignore=None, params=None):
attrs = attrs or self.read_json()
ignore = ignore or set()
ignore.add('content_view_component')
if entity is None:
try:
entity = type(self)(self._server_config)
except TypeError:
# in the event that an entity's init is overwritten
# with a positional server_config
entity = type(self)()
if self._server_config:
entity._server_config = self._server_config
result = super().read(entity, attrs, ignore, params)
if 'content_view_components' in attrs and attrs['content_view_components']:
result.content_view_component = [
Expand Down

0 comments on commit 2677667

Please sign in to comment.