|
|
|
@ -61,6 +61,15 @@ def add_awards(): |
|
|
|
return lottery.add_awards(b.request.json['awards']) |
|
|
|
return lottery.add_awards(b.request.json['awards']) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/add_award') |
|
|
|
|
|
|
|
def add_award(): |
|
|
|
|
|
|
|
name = b.request.params.get('award_name') |
|
|
|
|
|
|
|
award_capacity = b.request.params.get('award_capacity') |
|
|
|
|
|
|
|
if None in (name, award_capacity): |
|
|
|
|
|
|
|
b.abort(403) |
|
|
|
|
|
|
|
return lottery.add_awards({'award_name': name, 'award_capacity': award_capacity}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@app.route('/reset') |
|
|
|
@app.route('/reset') |
|
|
|
def reset(): |
|
|
|
def reset(): |
|
|
|
return lottery.reset() |
|
|
|
return lottery.reset() |
|
|
|
|