Skip to content

Commit 1a1e5ba

Browse files
authored
Endpoint get or create: Do not raise warning when there is an existing endpoint (#10555)
When a single endpoints is found in the endpoint get or create helper method, we do not want to raise a warning
1 parent 516997d commit 1a1e5ba

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

dojo/endpoint/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ def endpoint_get_or_create(**kwargs):
7979
count = qs.count()
8080
if count == 0:
8181
return Endpoint.objects.get_or_create(**kwargs)
82+
elif count == 1:
83+
return qs.order_by("id").first(), False
8284
else:
8385
logger.warning(
8486
f"Endpoints in your database are broken. "

0 commit comments

Comments
 (0)