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

decimal values passed as string now work (again) #316

Closed
wants to merge 1 commit into from
Closed

decimal values passed as string now work (again) #316

wants to merge 1 commit into from

Conversation

roadsideseb
Copy link

I am not a 100% sure that this is a fix for Oscar. I suggest this
change to be included because of the following reasons:

  1. The previous implementation of the currency filter (pre-Babel)
    would return an empty string '' whenever an invalid type was
    passed in. It think it makes sense to be backwards compatible.
  2. Applying the currency filter fails when passing in an empty
    string. This means that whenever the currency filter is applied
    it has to be ensured that it is not an empty value. Otherwise
    the filter raises an exception.
    This might cause additional issues due to the way the Djangoo
    templating system usually fails silently.

Please take a look at the suggested code in the commit and let me
know if this is a feasible addition/extension.

I am not a 100% sure that this is a fix for Oscar. I suggest this
change to be included because of the following reasons:

1. The previous implementation of the currency filter (pre-Babel)
    would return an empty string '' whenever an invalid type was
    passed in. It think it makes sense to be backwards compatible.

2. Applying the currency filter fails when passing in an empty
    string. This means that whenever the currency filter is applied
    it has to be ensured that it is not an empty value. Otherwise
    the filter raises an exception.
    This might cause additional issues due to the way the Djangoo
    templating system usually fails silently.

Please take a look at the suggested code in the commit and let me
know if this is a feasible addition/extension.
@roadsideseb
Copy link
Author

Thanks for looking into it and sorry about the string thing. I must have overlooked that when I read your first comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants