Web: Hours worked field doesn't support decimal values

Created on 20 Aug 2020  Â·  8Comments  Â·  Source: gitcoinco/web

Describe the bug

When posting a bounty the hours worked must be an integer, otherwise you get the error "unable to create bounty please try again later"
image

To Reproduce

Try creating a bounty with a non-integer value in that field.

Expected behavior

Either the field should have validation or non-integer values should be allowed.

Cause

Probably related to:

https://sentry.io/organizations/gitcoin/issues/1850523990/?project=1398424&query=is%3Aunresolved
ValueError: invalid literal for int() with base 10: '0.5'

Most helpful comment

I feel the better solution will be just work with integers on that value since we don't want people submitting 1.05 hours.
So probably just a front end validation to avoid decimals.

All 8 comments

anyone want? @gitcoinco/engineers @zoek1 @developerfred

@ceresstation I will change the model to accept float values

I feel the better solution will be just work with integers on that value since we don't want people submitting 1.05 hours.
So probably just a front end validation to avoid decimals.

Found a similar issue while submitting bounty as well. The hours worked field allows decimal input, but on submission the bounty doesn't get accepted. Console error says hours worked is missing, and there is no prompt to the user saying decimal values are not allowed.

I think the input it's fine to work only with intengers.

Can't reproduce what @Anoof says as the input is already invalidating any decimal value

input

I was referring to the bounty claim submission form, where this validation is not present. I think this same validation needs to be there as well.

bounty-float-bug

@aamustapha would you be able add that logic to the bounty submission as well ?

Sure

On Thu, Sep 17, 2020, 4:54 AM Aditya Anand M C notifications@github.com
wrote:

@aamustapha https://github.com/aamustapha would you be able add that
logic to the bounty submission as well ?

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pelsasser picture pelsasser  Â·  4Comments

Skyge picture Skyge  Â·  3Comments

christianbundy picture christianbundy  Â·  3Comments

IgorPerikov picture IgorPerikov  Â·  3Comments

kziemianek picture kziemianek  Â·  3Comments