Skip to content

Bugfix stop_date and suspended field in project#505

Merged
kbeker merged 1 commit intomasterfrom
bugfix-suspended-field-in-project
Aug 12, 2019
Merged

Bugfix stop_date and suspended field in project#505
kbeker merged 1 commit intomasterfrom
bugfix-suspended-field-in-project

Conversation

@Szymiks
Copy link
Contributor

@Szymiks Szymiks commented Aug 12, 2019

Resolve: #70

When project 'stop_date is not null' then it can't be suspended

@Szymiks Szymiks added bug Something isn't working priority medium Tasks with medium priority labels Aug 12, 2019
@Szymiks Szymiks added this to the v1.0.0 milestone Aug 12, 2019
@Szymiks Szymiks self-assigned this Aug 12, 2019
@kbeker kbeker force-pushed the bugfix-suspended-field-in-project branch from 84909b6 to abe4be9 Compare August 12, 2019 09:36
Copy link
Contributor

@kbeker kbeker left a comment

Choose a reason for hiding this comment

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

Looks good :)

def change_suspended_if_project_has_stop_date(sender: Project, **kwargs: Any) -> None:
assert sender == Project
Project.objects.filter(pk=kwargs["instance"].pk).update(
suspended=Case(When(~Q(stop_date=None), then=Value(False)), default=kwargs["instance"].suspended)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nicely done :)

@kbeker kbeker merged commit abe4be9 into master Aug 12, 2019
@kbeker kbeker deleted the bugfix-suspended-field-in-project branch August 12, 2019 09:43
@kbeker kbeker modified the milestones: v1.0.0, v0.9.0 Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working priority medium Tasks with medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Completed project shouldn't be suspended

2 participants