Commit ac4b1d84 authored by Samuel GAIST's avatar Samuel GAIST Committed by Flavio TARSETTI
Browse files

[attestations][commands][clean_attestations] Code cleanup

Removed useless boolean variable
parent 7dc06ec2
......@@ -39,8 +39,6 @@ class Command(InteractiveCommand):
help = "Cleanup outdated attestations"
def handle(self, *args, **options):
clean = True
if options["interactive"]:
try:
answer = self.get_input_data(
......@@ -54,12 +52,11 @@ class Command(InteractiveCommand):
self.stdout.write("Cleanup canceled")
sys.exit(1)
if clean:
expired_attestations = Attestation.objects.filter(
locked=True, expiration_date__lte=date.today()
)
attestion_count = expired_attestations.count()
expired_attestations.delete()
self.stdout.write(
"{} attestation(s) successfully cleaned".format(attestion_count)
)
expired_attestations = Attestation.objects.filter(
locked=True, expiration_date__lte=date.today()
)
attestion_count = expired_attestations.count()
expired_attestations.delete()
self.stdout.write(
"{} attestation(s) successfully cleaned".format(attestion_count)
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment