Add 'status' to 'create-proposals'

This commit is contained in:
Daniel Ternyak 2019-02-17 13:49:11 -06:00
parent da889a4f58
commit 16e632018a
No known key found for this signature in database
GPG Key ID: DF212D2DC5D0E245
1 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@ from flask.cli import with_appcontext
from .models import Proposal, db
from grant.milestone.models import Milestone
from grant.comment.models import Comment
from grant.utils.enums import ProposalStatus, Category
from grant.utils.enums import ProposalStatus, Category, ProposalStageEnum
from grant.user.models import User
@ -34,7 +34,12 @@ def create_proposal(stage, user_id, proposal_id, title, content):
def create_proposals(count):
user = User.query.filter_by().first()
for i in range(count):
if i < 5:
stage = ProposalStageEnum.FUNDING_REQUIRED
else:
stage = ProposalStageEnum.COMPLETED
p = Proposal.create(
stage=stage,
status=ProposalStatus.LIVE,
title=f'Fake Proposal #{i}',
content=f'My fake proposal content, numero {i}',