Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

fix: update report billed flag to be like project billed flag #988

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MitanOmar
Copy link
Member

No description provided.

@MitanOmar MitanOmar self-assigned this Feb 29, 2024
@MitanOmar MitanOmar requested a review from a team as a code owner February 29, 2024 15:18
@MitanOmar
Copy link
Member Author

fix adfinis/timed#72

@@ -267,8 +267,7 @@ def bulk(self, request):
if "task" in fields:
# unreject report if task has changed
fields["rejected"] = False
if fields["task"].project.billed:
fields["billed"] = fields["task"].project.billed
fields["billed"] = fields["task"].project.billed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could set fields["billed"] to None which is not the same as False. Not sure if it would be appropriate to default fields["billed"] to False, similar to the above fields["rejected"]

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i make it sure that the value will be true or false

@MitanOmar MitanOmar force-pushed the update-report-billed-flag-to-be-like-project-billed-flag branch from 2baa0f5 to eba561e Compare February 29, 2024 15:54
@@ -267,8 +267,7 @@ def bulk(self, request):
if "task" in fields:
# unreject report if task has changed
fields["rejected"] = False
if fields["task"].project.billed:
fields["billed"] = fields["task"].project.billed
fields["billed"] = True if fields["task"].project.billed else False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fields["billed"] = True if fields["task"].project.billed else False
fields["billed"] = fields["task"].project.billed

this should also work since its a boolean

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c0rydoras that's where this started off at #988 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fields["billed"] = bool(fields["task"].project.billed)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it isn't a boolean this accomplishes the same

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

Successfully merging this pull request may close these issues.

None yet

4 participants