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

bug: You cannot submit weekly billing for a project under hourly billing #1728

Closed
cantsin opened this issue Mar 4, 2024 · 3 comments · Fixed by #1730
Closed

bug: You cannot submit weekly billing for a project under hourly billing #1728

cantsin opened this issue Mar 4, 2024 · 3 comments · Fixed by #1730
Assignees
Labels

Comments

@cantsin
Copy link
Member

cantsin commented Mar 4, 2024

During the last few weeks, we have repeatedly gotten user feedback in #tock that the following error sometimes comes up when submitting time cards:

image

There was an error processing your time card

  • You cannot submit weekly billing for a project under hourly billing.

We thought we fixed this over at #1575 but I think this problem has come up in a different form. In particular, this is now happening (but not exclusively so) for prefilled time cards -- that is, time cards that carry over from the previous week.

Not sure how to reproduce, yet, but we can start by looking at these affected users' time cards.

@cantsin cantsin added the bug label Mar 4, 2024
@neilmb neilmb self-assigned this Mar 4, 2024
@neilmb
Copy link
Member

neilmb commented Mar 4, 2024

I'll look into this. Could it come from pre-filled time cards that lack some of the validation that went into #1575 (because they are getting made on the back end)?

@cantsin
Copy link
Member Author

cantsin commented Mar 4, 2024

That is indeed my hypothesis. It'd be nice to fix this problem once and for all so thank you for taking this one on 🙏🏻

@neilmb
Copy link
Member

neilmb commented Mar 11, 2024

I was able to extract the HTML page for the timecard page from one of the users experiencing this problem and it seems close to what we might have guessed. The POST request from that timecard page is sending "project_allocation" as zero instead of a blank.

Screenshot 2024-03-11 at 1 29 18 PM

In our code that handles this form submission https://github.com/18F/tock/blob/main/tock/hours/forms.py#L187 we check to see whether project_allocation is the empty string, but since a 0 is being submitted here, we get the error seen above.

Still thinking about the right fix. Either add "0" to the check on that line or figure out why these are being sent as zeroes and prevent that from happening.

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

Successfully merging a pull request may close this issue.

2 participants