Skip to content

Commit 342b2d3

Browse files
committed
Removed the unnecessary get_and_create() of community.model.DisplayConfiguration on community page GET.
- Legacy-Id: 9010
1 parent 05a617d commit 342b2d3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

ietf/community/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ def get_manage_url(self):
6969
def get_display_config(self):
7070
dconfig = getattr(self, '_cached_dconfig', None)
7171
if not dconfig:
72-
self._cached_dconfig = DisplayConfiguration.objects.get_or_create(community_list=self)[0]
72+
try:
73+
self._cached_dconfig = DisplayConfiguration.objects.get(community_list=self)
74+
except DisplayConfiguration.DoesNotExist:
75+
self._cached_dconfig = DisplayConfiguration(community_list=self)
7376
return self._cached_dconfig
7477
return self._cached_dconfig
7578

0 commit comments

Comments
 (0)