Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

circulation: unable to display a patron account in public view when he has a dispute. #1272

Closed
benerken opened this issue Oct 9, 2020 · 0 comments · Fixed by #1299
Closed
Assignees
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend f: public ui Public interface, as opposed to the professional interface

Comments

@benerken
Copy link
Contributor

benerken commented Oct 9, 2020

Describe the bug
The issue occurs in the public view, when the patron is logged and he wants to access its profile.
If he has a "dispute" transaction in the history of fees, he gets an internal server error on the screen.

The server logs shows this kind of message:

File "/invenio/.cache/pypoetry/virtualenvs/rero-ils-Ta2-9VdS-py3.6/lib/python3.6/site-packages/jinja2/runtime.py", line 679, in _invoke
rv = self._func(*arguments)
File "/invenio/src/rero_ils/modules/patrons/templates/rero_ils/_macro_profile.html", line 123, in template
{{ event.amount | format_currency(event.currency) }}
File "./rero_ils/modules/patrons/views.py", line 238, in format_currency_filter
return format_currency(value, currency)
File "/invenio/.cache/pypoetry/virtualenvs/rero-ils-Ta2-9VdS-py3.6/lib/python3.6/site-packages/flask_babelex/init.py", line 444, in format_currency
number, currency, format=format, locale=locale
File "/invenio/.cache/pypoetry/virtualenvs/rero-ils-Ta2-9VdS-py3.6/lib/python3.6/site-packages/babel/numbers.py", line 521, in format_currency
decimal_quantization=decimal_quantization)
File "/invenio/.cache/pypoetry/virtualenvs/rero-ils-Ta2-9VdS-py3.6/lib/python3.6/site-packages/babel/numbers.py", line 943, in apply
value = decimal.Decimal(str(value))
decimal.InvalidOperation: [<class 'decimal.ConversionSyntax'>]

To Reproduce

  1. Go to ilsdev.test.rero.ch
  2. login as Astrid and go to the professional interface.
  3. Take the account of Simonetta, Tabs "Fees" and do a dispute for an open fee
  4. Logout, then login as Simonetta
  5. In the public view, try to access the patron profie. You should get an Internal Server Error.

Expected behavior
A patron with fees (and dispute) should be able to display its profile.

Context
Tell us on what server did you spotted the issue, using with browser.

  • server: ilsdev.test.rero.ch
  • version: 0.12
@benerken benerken added f: circulation Concerns the circulation interface or backend f: public ui Public interface, as opposed to the professional interface triage bug Breaks something but is not blocking labels Oct 9, 2020
@benerken benerken changed the title circulation: unable to display a patron account in public view he has a dispute. circulation: unable to display a patron account in public view when he has a dispute. Oct 9, 2020
@zannkukai zannkukai self-assigned this Oct 13, 2020
zannkukai added a commit to zannkukai/rero-ils that referenced this issue Oct 13, 2020
When a patron has some fees containing at least one 'dispute' event, the
server crash because ii tries to convert the amount of dispute (always
none) to a decimal number. This PR fix this problem checking if the
event to display has a valid 'amount' attribute. This PR also fixes some
small HTML problems on the patron profile.

Closes rero#1272

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
@zannkukai zannkukai removed the triage label Oct 13, 2020
zannkukai added a commit to zannkukai/rero-ils that referenced this issue Oct 14, 2020
When a patron has some fees containing at least one 'dispute' event, the
server crash because ii tries to convert the amount of dispute (always
none) to a decimal number. This PR fix this problem checking if the
event to display has a valid 'amount' attribute. This PR also fixes some
small HTML problems on the patron profile.

Closes rero#1272

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
zannkukai added a commit to zannkukai/rero-ils that referenced this issue Oct 14, 2020
When a patron has some fees containing at least one 'dispute' event, the
server crash because ii tries to convert the amount of dispute (always
none) to a decimal number. This PR fix this problem checking if the
event to display has a valid 'amount' attribute. This PR also fixes some
small HTML problems on the patron profile.

Closes rero#1272

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
zannkukai added a commit to zannkukai/rero-ils that referenced this issue Oct 14, 2020
When a patron has some fees containing at least one 'dispute' event, the
server crash because ii tries to convert the amount of dispute (always
none) to a decimal number. This PR fix this problem checking if the
event to display has a valid 'amount' attribute. This PR also fixes some
small HTML problems on the patron profile.

Closes rero#1272

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
@jma jma closed this as completed in #1299 Oct 14, 2020
jma pushed a commit that referenced this issue Oct 14, 2020
When a patron has some fees containing at least one 'dispute' event, the
server crash because ii tries to convert the amount of dispute (always
none) to a decimal number. This PR fix this problem checking if the
event to display has a valid 'amount' attribute. This PR also fixes some
small HTML problems on the patron profile.

Closes #1272

Co-Authored-by: Renaud Michotte <renaud.michotte@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Breaks something but is not blocking f: circulation Concerns the circulation interface or backend f: public ui Public interface, as opposed to the professional interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants