Development fund page has non-functioning currency option. #76716

Closed
opened 2020-05-13 11:56:10 +02:00 by Alaska · 12 comments

System Information:
Operating system: Linux
Web browser: Google Chrome 81.0.4044.138

Page broken:
https://fund.blender.org/

Description of error:
At the bottom of the Blender development fund page there is a drop down to select a currency. Changing this between USD and Euro does not seem to change the currency as all prices are still listed as $ and all values stay the same.

**System Information:** Operating system: Linux Web browser: Google Chrome 81.0.4044.138 **Page broken:** https://fund.blender.org/ **Description of error:** At the bottom of the [Blender development fund ](https://fund.blender.org/) page there is a drop down to select a currency. Changing this between USD and Euro does not seem to change the currency as all prices are still listed as $ and all values stay the same.
Author

Added subscriber: @Alaska

Added subscriber: @Alaska

Added subscriber: @EAW

Added subscriber: @EAW

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'

Confirmed using Windows 10 and Firefox 76.0.1

Confirmed using Windows 10 and Firefox 76.0.1

Added subscribers: @fsiddi, @ankitm

Added subscribers: @fsiddi, @ankitm

This page opens in browser though.

  Failed to load resource: the server responded with a status of 403 ()  https://fund.blender.org/preferred-currency 

So the

function set_preferred_currency(currency) {
    $.post('/preferred-currency', {'preferred_currency': currency})
    .fail(function(error) {
        console.log('Error setting preferred currency:', error);
    })
    .done(function() {
        // Show the change in currency by reloading the current window.
        window.location.reload();
    })
}

gives out error & doesn't refresh the page.
CC @fsiddi

This page opens in browser though. ``` Failed to load resource: the server responded with a status of 403 () https://fund.blender.org/preferred-currency ``` So the ``` function set_preferred_currency(currency) { $.post('/preferred-currency', {'preferred_currency': currency}) .fail(function(error) { console.log('Error setting preferred currency:', error); }) .done(function() { // Show the change in currency by reloading the current window. window.location.reload(); }) } ``` gives out error & doesn't refresh the page. CC @fsiddi

Added subscriber: @ronsn

Added subscriber: @ronsn

The response code 403 means "forbidden". It seems that you are sending POST data and your backend validation doesn't like that data. It asks for a key to avoid a cross-site request forgery (CSRF). So you have to send also a form key, or csrfkey, or how it is called in your system. E.g. by putting this key into a hidden form field, or setting it via JS. :)

The response code 403 means "forbidden". It seems that you are sending POST data and your backend validation doesn't like that data. It asks for a key to avoid a cross-site request forgery (CSRF). So you have to send also a form key, or csrfkey, or how it is called in your system. E.g. by putting this key into a hidden form field, or setting it via JS. :)

I can confirm that the request fails when the user is not logged into the site because a CSRF token is not generated in the template. Will look into a fix soon.

I can confirm that the request fails when the user is not logged into the site because a CSRF token is not generated in the template. Will look into a fix soon.

This issue was referenced by c4f463f9a4

This issue was referenced by c4f463f9a47bfe8573f7bff621d7c588a79c11b1

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Francesco Siddi self-assigned this 2020-05-29 09:29:15 +02:00
Author

Thank you @fsiddi

Thank you @fsiddi
Sign in to join this conversation.
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: infrastructure/devfund-website#76716
No description provided.