|
16 | 16 | from dojo.celery import app |
17 | 17 | from dojo.celery_dispatch import dojo_dispatch_task |
18 | 18 | from dojo.finding.helper import fix_loop_duplicates |
19 | | -from dojo.location.models import Location |
20 | 19 | from dojo.management.commands.jira_status_reconciliation import jira_status_reconciliation |
21 | | -from dojo.models import Alerts, Announcement, Endpoint, Engagement, Finding, Product, System_Settings, User |
| 20 | +from dojo.models import Alerts, Engagement, Finding, Product, System_Settings, User |
22 | 21 | from dojo.notifications.helper import create_notification |
23 | 22 | from dojo.utils import calculate_grade, sla_compute_and_notify |
24 | 23 |
|
@@ -218,37 +217,6 @@ def fix_loop_duplicates_task(*args, **kwargs): |
218 | 217 | return fix_loop_duplicates() |
219 | 218 |
|
220 | 219 |
|
221 | | -@app.task |
222 | | -def evaluate_pro_proposition(*args, **kwargs): |
223 | | - # Ensure we should be doing this |
224 | | - if not settings.CREATE_CLOUD_BANNER: |
225 | | - return |
226 | | - # Get the announcement object |
227 | | - announcement = Announcement.objects.get_or_create(id=1)[0] |
228 | | - # Quick check for a user has modified the current banner - if not, exit early as we dont want to stomp |
229 | | - if not any( |
230 | | - entry in announcement.message |
231 | | - for entry in [ |
232 | | - "", |
233 | | - "DefectDojo Pro Cloud and On-Premise Subscriptions Now Available!", |
234 | | - "Findings/Endpoints in their systems", |
235 | | - ] |
236 | | - ): |
237 | | - return |
238 | | - # Count the objects the determine if the banner should be updated |
239 | | - if settings.V3_FEATURE_LOCATIONS: |
240 | | - object_count = Finding.objects.count() + Location.objects.count() |
241 | | - else: |
242 | | - # TODO: Delete this after the move to Locations |
243 | | - object_count = Finding.objects.count() + Endpoint.objects.count() |
244 | | - # Unless the count is greater than 100k, exit early |
245 | | - if object_count < 100000: |
246 | | - return |
247 | | - # Update the announcement |
248 | | - announcement.message = f'Only professionals have {object_count:,} Findings and Endpoints in their systems... <a href="https://www.defectdojo.com/pricing" target="_blank">Get DefectDojo Pro</a> today!' |
249 | | - announcement.save() |
250 | | - |
251 | | - |
252 | 220 | @app.task |
253 | 221 | def clear_sessions(*args, **kwargs): |
254 | 222 | call_command("clearsessions") |
|
0 commit comments