Files @ ba1df47d695b
Branch filter:

Location: symposion_app/symposion/reviews/management/commands/promoteproposals.py

Patrick Altman
Remove templates

These have all been moved to the starter project,
pinax-project-symposion. The reasoning behind this is they are very
specific to the theme (pinax-theme-bootstrap) that the project uses and
not really all that reusable when packaged with this app.
from django.core.management.base import BaseCommand
from django.db import connections

from symposion.reviews.models import ProposalResult, promote_proposal


class Command(BaseCommand):

    def handle(self, *args, **options):
        accepted_proposals = ProposalResult.objects.filter(status="accepted")
        accepted_proposals = accepted_proposals.order_by("proposal")

        for result in accepted_proposals:
            promote_proposal(result.proposal)
        connections["default"].cursor().execute(
            "SELECT setval('schedule_session_id_seq', (SELECT max(id) FROM schedule_session))")