Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added backend/audit/fixtures/federalist-2.pdf
Binary file not shown.
Binary file added backend/audit/fixtures/federalist.pdf
Binary file not shown.
Binary file added backend/audit/fixtures/o-captain-2.pdf
Binary file not shown.
Binary file added backend/audit/fixtures/o-captain.pdf
Binary file not shown.
Binary file added backend/audit/fixtures/permanent-markers-2.pdf
Binary file not shown.
Binary file added backend/audit/fixtures/permanent-markers.pdf
Binary file not shown.
26 changes: 26 additions & 0 deletions backend/audit/management/commands/compare_with_previous.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from django.core.management.base import BaseCommand

import logging
from django.contrib.auth import get_user_model
from pprint import pprint

from audit.viewlib.compare_two_submissions import compare_with_prev

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

User = get_user_model()


class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("report_id", type=str)

def handle(self, *args, **options):
rid = options["report_id"]

# This is actually sneaky. Given a report ID, it either
# compares to the previous (if one exists), or if no prev
# exists, but a *next* DOES exist, it flips the order and
# compares next to this one.
pprint(compare_with_prev(rid))
Loading