def _update_improperly_enddated_applications(now=None): if not now: now = timezone.now() improperly_enddated_apps = Application.objects.annotate( num_versions=Count('versions'), num_machines=Count('versions__machines')).filter( inactive_versions(), # AND application has already been end-dated. end_date__isnull=False) app_count = _perform_end_date(improperly_enddated_apps, now) return app_count
def _update_improperly_enddated_applications(now=None): if not now: now = timezone.now() improperly_enddated_apps = Application.objects.annotate( num_versions=Count('versions'), num_machines=Count('versions__machines') ).filter( inactive_versions(), # AND application has already been end-dated. end_date__isnull=False ) app_count = _perform_end_date(improperly_enddated_apps, now) return app_count