Skip to content

Commit

Permalink
case of not providing environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hblankenship committed Oct 11, 2024
1 parent 42aeb9f commit 13c179d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dojo/api_v2/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2177,7 +2177,7 @@ def set_context(
context["scan"] = data.pop("file", None)

if context.get("auto_create_context"):
environment = Development_Environment.objects.get_or_create(name=data.get("environment"))[0]
environment = Development_Environment.objects.get_or_create(name=data.get("environment", "Development"))[0]
else:
try:
environment = Development_Environment.objects.get(name=data.get("environment", "Development"))
Expand Down Expand Up @@ -2464,7 +2464,7 @@ def set_context(
context["scan"] = data.get("file", None)

if context.get("auto_create_context"):
environment = Development_Environment.objects.get_or_create(name=data.get("environment"))[0]
environment = Development_Environment.objects.get_or_create(name=data.get("environment", "Development"))[0]
else:
try:
environment = Development_Environment.objects.get(name=data.get("environment", "Development"))
Expand Down

0 comments on commit 13c179d

Please sign in to comment.