Skip to content

Commit

Permalink
ISSUSES: patron parcode
Browse files Browse the repository at this point in the history
* FIX: patron parcode missing
* closes rero#37
* closes rero#48

Signed-off-by: Peter Weber <[email protected]>
  • Loading branch information
rerowep committed Nov 9, 2018
1 parent 8647598 commit 9a74f77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,7 @@ def _(x):
form_options_create_exclude=['pid'],
),
_('item'): dict(
api='/api/items/',
editor_template='rero_ils/item_editor.html',
schema='items/item-v0.0.1.json',
form_options=(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
{
"key": "barcode",
"condition": "model.is_patron == true",
"required": true,
"htmlClass": "col-xs-6",
"validationMessage": {
"alreadyTakenMessage": "The barcode is already taken",
Expand All @@ -140,6 +141,7 @@
{
"key": "patron_type_pid",
"condition": "model.is_patron == true",
"required": true,
"htmlClass": "col-xs-6",
"populate": "patron_names_descriptions",
"type": "select"
Expand All @@ -159,6 +161,7 @@
"key": "library_pid",
"htmlClass": "col-xs-6",
"condition": "model.is_staff == true",
"required": true,
"populate": "locations_pids_names",
"type": "select"
}
Expand Down Expand Up @@ -186,4 +189,4 @@
}
]
}
]
]
4 changes: 2 additions & 2 deletions rero_ils/modules/patrons/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def save_patron(data, record_type, record_class, parent_pid):
confirm_user(user)

patron = record_class.get_patron_by_email(email)
data['is_patron'] = data.get('is_patron', False)
data['is_staff'] = data.get('is_staff', False)
if patron:
patron.update(data, dbcommit=True, reindex=False)
patron = record_class.get_patron_by_email(email)
Expand All @@ -86,8 +88,6 @@ def save_patron(data, record_type, record_class, parent_pid):
patron.remove_role('cataloguer')
# TODO: cataloguer role
patron.remove_role('staff')
patron.dbcommit(reindex=True)
RecordIndexer().client.indices.flush()

_next = url_for('invenio_records_ui.ptrn', pid_value=patron.pid)
return _next, patron.pid
Expand Down

0 comments on commit 9a74f77

Please sign in to comment.