Skip to content

Commit

Permalink
Merge pull request #234 from StartupsPoleEmploi/acantin/save_score_al…
Browse files Browse the repository at this point in the history
…ternance_office_add

OfficeAdd => set score_alternance in form
  • Loading branch information
AlexandreCantin committed Jul 27, 2018
2 parents 65d9fd3 + 74fe96a commit 3dee3c6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions labonneboite/tests/scripts/test_create_index.py
Expand Up @@ -116,6 +116,7 @@ def test_office_admin_add(self):
"departement": "57",
"headcount": "12",
"score": 90,
"score_alternance": 75,
"x": 6.17952,
"y": 49.1044,
"reason": "Demande de mise en avant",
Expand Down
8 changes: 8 additions & 0 deletions labonneboite/web/admin/views/office_admin_add.py
Expand Up @@ -49,6 +49,7 @@ class OfficeAdminAddModelView(AdminModelViewMixin, ModelView):
'departement',
'headcount',
'score',
'score_alternance',
'x',
'y',
'reason',
Expand Down Expand Up @@ -82,6 +83,7 @@ class OfficeAdminAddModelView(AdminModelViewMixin, ModelView):
'departement': "Département",
'headcount': "Tranche effectif",
'score': "Score",
'score_alternance': "Score alternance",
'x': "Longitude",
'y': "Latitude",
'reason': "Raison",
Expand All @@ -93,6 +95,8 @@ class OfficeAdminAddModelView(AdminModelViewMixin, ModelView):

column_descriptions = {
'reason': "Raison de l'ajout.",
'score': "Valeur recommandée : entre 80 et 90",
'score_alternance': "Valeur recommandée : entre 80 et 90",
}

form_columns = [
Expand All @@ -114,6 +118,7 @@ class OfficeAdminAddModelView(AdminModelViewMixin, ModelView):
'flag_handicap',
'headcount',
'score',
'score_alternance',
'y',
'x',
'reason',
Expand Down Expand Up @@ -172,6 +177,9 @@ class OfficeAdminAddModelView(AdminModelViewMixin, ModelView):
'score': {
'validators': [validators.NumberRange(min=0, max=100)],
},
'score_alternance': {
'validators': [validators.NumberRange(min=0, max=100)],
},
'reason': {
'filters': [strip_filter],
},
Expand Down

0 comments on commit 3dee3c6

Please sign in to comment.