-
Notifications
You must be signed in to change notification settings - Fork 24
fix: update report billed flag to be like project billed flag #988
base: main
Are you sure you want to change the base?
fix: update report billed flag to be like project billed flag #988
Conversation
fix adfinis/timed#72 |
timed/tracking/views.py
Outdated
@@ -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 |
There was a problem hiding this comment.
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"]
There was a problem hiding this comment.
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
2baa0f5
to
eba561e
Compare
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields["billed"] = True if fields["task"].project.billed else False | |
fields["billed"] = fields["task"].project.billed |
this should also work since its a boolean
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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
No description provided.