Skip to content

Commit

Permalink
[frontend] default value for python_versions was not applied on POST …
Browse files Browse the repository at this point in the history
…request

Perhaps there is better (generic) solution to this problem
  • Loading branch information
clime committed Mar 3, 2016
1 parent b39dd64 commit b78a588
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/coprs_frontend/coprs/views/api_ns/api_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,10 @@ def copr_new_build_upload(copr):
def copr_new_build_pypi(copr):
form = forms.BuildFormPyPIFactory(copr.active_chroots)(csrf_enabled=False)

# TODO: automatically prepopulate all form fields with their defaults
if not form.python_versions.data:
form.python_versions.data = form.python_versions.default

# are there any arguments in POST which our form doesn't know?
if any([post_key not in form.__dict__.keys()
for post_key in flask.request.form.keys()]):
Expand Down

0 comments on commit b78a588

Please sign in to comment.