Skip to content

Commit 0ddd362

Browse files
committed
for pro proposition banner, use location count if v3 enabled
1 parent acf1c78 commit 0ddd362

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dojo/tasks.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from dojo.celery import app
1515
from dojo.decorators import dojo_async_task
1616
from dojo.finding.helper import fix_loop_duplicates
17+
from dojo.location.models import Location
1718
from dojo.management.commands.jira_status_reconciliation import jira_status_reconciliation
1819
from dojo.models import Alerts, Announcement, Endpoint, Engagement, Finding, Product, System_Settings, User
1920
from dojo.notifications.helper import create_notification
@@ -223,7 +224,11 @@ def evaluate_pro_proposition(*args, **kwargs):
223224
):
224225
return
225226
# Count the objects the determine if the banner should be updated
226-
object_count = Finding.objects.count() + Endpoint.objects.count()
227+
if settings.V3_FEATURE_LOCATIONS:
228+
object_count = Finding.objects.count() + Location.objects.count()
229+
else:
230+
# TODO: Delete this after the move to Locations
231+
object_count = Finding.objects.count() + Endpoint.objects.count()
227232
# Unless the count is greater than 100k, exit early
228233
if object_count < 100000:
229234
return

0 commit comments

Comments
 (0)