Skip to content
Snippets Groups Projects
Select Git revision
  • 921bf9fbf881c9c605d66fb71a1d9967e385f747
  • test default protected
  • master protected
  • feat/custom-css
  • feat/redesign-improvements-10
  • feat/redesign-improvements-8
  • feat/redesign-fixes-3
  • feat/pirstan-changes
  • feat/separate-import-thread
  • feat/dary-improvements
  • features/add-pdf-page
  • features/add-typed-table
  • features/fix-broken-calendar-categories
  • features/add-embed-to-articles
  • features/create-mastodon-feed-block
  • features/add-custom-numbering-for-candidates
  • features/add-timeline
  • features/create-wordcloud-from-article-page
  • features/create-collapsible-extra-legal-info
  • features/extend-hero-banner
  • features/add-link-to-images
21 results

parser.py

Blame
  • helios_trustee_decrypt.py 1022 B
    """
    decrypt elections where Helios is trustee
    
    DEPRECATED
    
    Ben Adida
    ben@adida.net
    2010-05-22
    """
    
    from django.core.management.base import BaseCommand
    
    from helios.models import Trustee
    
    
    class Command(BaseCommand):
        args = ''
        help = 'decrypt elections where helios is the trustee'
        
        def handle(self, *args, **options):
            # query for elections where decryption is ready to go and Helios is the trustee
            active_helios_trustees = Trustee.objects.exclude(secret_key = None).exclude(election__encrypted_tally = None).filter(decryption_factors = None)
    
            # for each one, do the decryption
            for t in active_helios_trustees:
                tally = t.election.encrypted_tally
    
                # FIXME: this should probably be in the encrypted_tally getter
                tally.init_election(t.election)
    
                factors, proof = tally.decryption_factors_and_proofs(t.secret_key)
                t.decryption_factors = factors
                t.decryption_proofs = proof
                t.save()