GeekZoneHQ / web

Software to power the Geek.Zone website and apps
http://geek.zone/web
GNU General Public License v3.0
19 stars 29 forks source link

No decimal values accepted as donation amounts #364

Closed giulio-giunta closed 2 years ago

giulio-giunta commented 3 years ago

Currently when registering through test.geek.zone/memberships/register the system does not allow to insert decimal amounts as a donation. This causes the site to return a code 500 error image

Impact

High

Urgency

Now

SamWinterhalder commented 3 years ago

Correct me if I am wrong, but is it PGL to fix this or could we limit the member to integer donations and make decimals P1? @Freshrojek

giulio-giunta commented 3 years ago

Hey guys,

I think James mentioned he'd want to manage donations in GBX.

If this complicates things a lot, for the time being I guess limiting members to integer donations would be the best approach, as this would prevent any error 500 response codes. Also, I think people would make integer donations anyway.

On the other hand, if it's possible to change the code easily and accept donations as decimal amounts, then the work would be done once for ever.

Giulio

On Sun, 18 Jul 2021, 17:46 Sam Winterhalder, @.***> wrote:

Correct me if I am wrong, but is it PGL to fix this or could we limit the member to integer donations and make decimals P1? @Freshrojek https://github.com/Freshrojek

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/GeekZoneHQ/web/issues/364#issuecomment-882084530, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPJIC5P2K7QFA2PBLILSU3TYMAN3ANCNFSM5ASE37KQ .

opheliah95 commented 3 years ago

Hey all,

I think if we are going to make it into a integer donation, it may be a bit more natural if we set donations to a drop-down tiers, like £5, £20 etc. So rather than enter a number, members can choose a number from the drop down? If it sounds complicated, we can drop this idea.

But I agree that we should look into the code and see if it can be easily fixed.

Ophelia

Freshrojek commented 3 years ago

Yeah I guess for now we need to make it only accept integers while we have a look at the decimals, but I don't think it's necessarily pgl but something that should be done sooner because James did want it done.

SamWinterhalder commented 3 years ago

Have found on line 160 of memberships/views.py we take the integer value of donation and create a total so this throws an error when supplied float.

total = 1 if not donation else int(donation) + 1

Unless people can see any reason not to, this will be made a float and rounded to 2 d.p. so requests made with x d.p. are rounded.

Freshrojek commented 3 years ago

Yeah we have rounded both donation and total to 2 decimal points in float, does this mean it is in GBX @giulio-giunta ?

jamesgeddes commented 3 years ago

@Freshrojek @SamWinterhalder @opheliah95 How are we getting on with this?

Freshrojek commented 3 years ago

@Freshrojek @SamWinterhalder @opheliah95 How are we getting on with this?

Last time I spoke to @SamWinterhalder, we needed to wait for logging.geek.zone to come online before trying the proper way

giulio-giunta commented 3 years ago

Hi guys,

The issue with logs filling up the volume is now solved. Btw, even with that, logs could be retrieved directly from Kubernetes anyway.

Giulio

On Thu, 23 Sep 2021, 13:49 Jack Boyer, @.***> wrote:

@Freshrojek https://github.com/Freshrojek @SamWinterhalder https://github.com/SamWinterhalder @opheliah95 https://github.com/opheliah95 How are we getting on with this?

Last time I spoke to @SamWinterhalder https://github.com/SamWinterhalder, we needed to wait for logging.geek.zone to come online before trying the proper way

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/GeekZoneHQ/web/issues/364#issuecomment-925783382, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANPJICYXGR3ZMUQXT3LVEULUDMO4RANCNFSM5ASE37KQ .

Freshrojek commented 3 years ago

Trying to progress on this but can't run the project locally as I'm fighting with psycopg2 errors >:(

jamesgeddes commented 3 years ago

@Freshrojek How did you get on with psycopg2? Need a hand?

Freshrojek commented 3 years ago

Alright thanks @giulio-giunta hopped on a call with me and really helped me out. Turns out my local sqllite3 and postgres settings were inconsistent :)

Freshrojek commented 2 years ago

PR #576 Closed this