Skip to content

Commit

Permalink
review issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Holger Burbach committed Feb 13, 2021
1 parent 6b5967a commit 3b5f1b7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,12 @@ def upgrade():
sa.ForeignKeyConstraint(['voting_phase_id'], ['votingphases.id'], name=op.f('fk_voting_id_counter_voting_phase_id_votingphases')),
sa.PrimaryKeyConstraint('proposition_type_id', 'voting_phase_id', name=op.f('pk_voting_id_counter'))
)
op.drop_table('voting_module')
op.drop_table('votingresults')
op.add_column('propositiontypes', sa.Column('voting_identifier_template', sa.Text(), nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('propositiontypes', 'voting_identifier_template')
op.create_table('votingresults',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('data', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('ballot_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='votingresults_pkey')
)
op.create_table('voting_module',
sa.Column('id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('name', sa.TEXT(), autoincrement=False, nullable=False),
sa.Column('description', sa.TEXT(), autoincrement=False, nullable=True),
sa.Column('base_url', sa.TEXT(), autoincrement=False, nullable=False),
sa.Column('module_type', sa.TEXT(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='pk_voting_module'),
sa.UniqueConstraint('name', name='uq_voting_module_name')
)
op.drop_table('voting_id_counter')
# ### end Alembic commands ###
3 changes: 2 additions & 1 deletion src/ekklesia_portal/concepts/ballot/ballot_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ekklesia_portal.app import App
from ekklesia_portal.datamodel import Ballot, SubjectArea, VotingPhase, VotingIdCounter
from ekklesia_portal.permission import EditPermission
import logging

from .ballot_cells import BallotCell, BallotsCell, EditBallotCell
from .ballot_contracts import BallotForm
Expand Down Expand Up @@ -77,7 +78,7 @@ def update(self, request, appstruct):
try:
proposition.voting_identifier= self.proposition_type.voting_identifier_template.format(v_id_cnt.counter)
except Exception as e:
print("\nproposition type {0}: invalid voting identifier template {1}\n".format(self.proposition_type.name, self.proposition_type.voting_identifier_template))
logging.error("\nproposition type {0}: invalid voting identifier template {1}\n".format(self.proposition_type.name, self.proposition_type.voting_identifier_template))
return HTTPBadRequest()

self.update(**appstruct)
Expand Down

0 comments on commit 3b5f1b7

Please sign in to comment.