Skip to content

Commit

Permalink
Circulation policy: issues
Browse files Browse the repository at this point in the history
 * FIX: closes #125, closes #127

Signed-off-by: Aly Badr <[email protected]>
  • Loading branch information
Aly Badr authored and iGor milhit committed Oct 25, 2018
1 parent 4fd768f commit 9956174
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 1 addition & 4 deletions data/circulation_policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
"description": "On-site circulation policy.",
"organisation_pid": "1",
"allow_checkout": false,
"checkout_duration": 0,
"allow_requests": false,
"number_renewals": 0,
"renewal_duration": 0
"allow_requests": false
}
]
2 changes: 2 additions & 0 deletions rero_ils/modules/circ_policies/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
from werkzeug.local import LocalProxy

from rero_ils.modules.circ_policies.api import CircPolicy
from rero_ils.modules.circ_policies.utils import clean_circ_policy_fields
from rero_ils.modules.errors import OrganisationDoesNotExist, \
PolicyNameAlreadyExists

Expand All @@ -53,6 +54,7 @@ def import_circ_policies(infile, verbose):
data = json.load(infile)
for circ_policy in data:
message = ''
circ_policy = clean_circ_policy_fields(circ_policy)
try:
record = CircPolicy.create(
circ_policy, dbcommit=True, reindex=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"type": "string"
},
"allow_checkout": {
"title": "Allow Checkout flag",
"title": "Allow Checkout",
"description": "Checkouts are allowed or not.",
"type": "boolean",
"default": true
Expand All @@ -49,10 +49,11 @@
"title": "Checkout duration in days",
"description": "The duration of the checkout in days.",
"type": "integer",
"minimum": 1,
"default": 7
},
"allow_requests": {
"title": "Allow patron requests flag",
"title": "Allow patron requests",
"description": "Patron requests are allowed or not.",
"type": "boolean",
"default": true
Expand All @@ -61,13 +62,14 @@
"title": "Maximum number of renewals",
"description": "Maximum number of renewals allowed.",
"type": "integer",
"minimum": 0,
"default": 0
},
"renewal_duration": {
"title": "Renewal duration in days",
"description": "The duration of the renewal in days.",
"type": "integer",
"default": 7
"minimum": 1
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h2> {{_('Circulation Policy')}}: {{ record.name }}</h2>
{{_('Checkout Duration')}}:
</div>
<div class="col-xs-9 col-sm-10">
{{ record.checkout_duration }}
{{ record.checkout_duration }} {{_('day(s)')}}
</div>
</div>
{% endif %}
Expand All @@ -74,7 +74,7 @@ <h2> {{_('Circulation Policy')}}: {{ record.name }}</h2>
{{_('Renewal Duration')}}:
</div>
<div class="col-xs-9 col-sm-10">
{{ record.renewal_duration }}
{{ record.renewal_duration }} {{_('day(s)')}}
</div>
</div>
{% endif %}
Expand Down

0 comments on commit 9956174

Please sign in to comment.