Skip to content

Commit

Permalink
Merge pull request #6936 from PennyDreadfulMTG/devdb
Browse files Browse the repository at this point in the history
Fix /admin/people/notes POST endpoint.
  • Loading branch information
vorpal-buildbot committed Dec 14, 2019
2 parents 305eca9 + 5b0f29d commit 7f2182d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions decksite/controllers/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ def player_notes() -> str:
return view.page()

@auth.admin_required
@fill_form('person_id', 'note')
@APP.route('/admin/people/notes/', methods=['POST'])
def post_player_note(person_id: int, note: str) -> wrappers.Response:
def post_player_note() -> wrappers.Response:
if not request.form.get('person_id') or not request.form.get('note'):
raise InvalidArgumentException(f'Did not find any of the expected keys in POST to /admin/people/notes: {request.form}')
creator = ps.load_person_by_discord_id(session['id'])
ps.add_note(creator.id, person_id, note)
ps.add_note(creator.id, request.form['person_id'], request.form['note'])
return redirect(url_for('player_notes'))

@auth.admin_required
Expand Down

0 comments on commit 7f2182d

Please sign in to comment.