(self, request, election, **kwargs)
return self.create_response(request, dict(status="success"))
Starts an election
Starts an election
Starts an election
def start_action(self, request, election, **kwargs):
        '''
        Starts an election
        '''

        tkwargs=dict(
            election_id=election.id,
            is_secure=request.is_secure(),
            site_id=Site.objects.get_current().id,
            remote_addr=request.META.get('REMOTE_ADDR'),
            user_id=request.user.id
        )

        election.last_modified_at_date = timezone.now()
        election.voting_starts_at_date = election.last_modified_at_date
        if not election.frozen_at_date:
            election.frozen_at_date = election.last_modified_at_date
        election.save()
        transaction.commit()

        start_election.apply_async(kwargs=tkwargs, task_id=election.task_id(start_election))
        return self.create_response(request, dict(status="success"))
def start_action ( self , request , election , * * kwargs ) : tkwargs = dict ( election_id = election . id , is_secure = request . is_secure ( ) , site_id = Site . objects . get_current ( ) . id , remote_addr = request . META . get ( 'REMOTE_ADDR' ) , user_id = request . user . id ) election . last_modified_at_date = timezone . now ( ) election . voting_starts_at_date = election . last_modified_at_date if not election . frozen_at_date : election . frozen_at_date = election . last_modified_at_date election . save ( ) transaction . commit ( ) start_election . apply_async ( kwargs = tkwargs , task_id = election . task_id ( start_election ) ) return self . create_response ( request , dict ( status = "success" ) )