def try_to_close_or_open_user_stories_when_edit_us_status(sender, instance, created, **kwargs):
    from taiga.projects.userstories import services

    for user_story in instance.user_stories.all():
        if services.calculate_userstory_is_closed(user_story):
            services.close_userstory(user_story)
        else:
            services.open_userstory(user_story)
Beispiel #2
0
def _try_to_close_or_open_us_when_delete_task(instance):
    from taiga.projects.userstories import services as us_service

    if instance.user_story_id:
        if us_service.calculate_userstory_is_closed(instance.user_story):
            us_service.close_userstory(instance.user_story)
        else:
            us_service.open_userstory(instance.user_story)
def try_to_close_or_open_user_stories_when_edit_task_status(sender, instance, created, **kwargs):
    from taiga.projects.userstories import services

    UserStory = apps.get_model("userstories", "UserStory")

    for user_story in UserStory.objects.filter(tasks__status=instance).distinct():
        if services.calculate_userstory_is_closed(user_story):
            services.close_userstory(user_story)
        else:
            services.open_userstory(user_story)
Beispiel #4
0
def _try_to_close_or_open_us_when_create_or_edit_task(instance):
    from taiga.projects.userstories import services as us_service

    if instance.user_story_id:
        if us_service.calculate_userstory_is_closed(instance.user_story):
            us_service.close_userstory(instance.user_story)
        else:
            us_service.open_userstory(instance.user_story)

    if instance.prev and instance.prev.user_story_id and instance.prev.user_story_id != instance.user_story_id:
        if us_service.calculate_userstory_is_closed(instance.prev.user_story):
            us_service.close_userstory(instance.prev.user_story)
        else:
            us_service.open_userstory(instance.prev.user_story)
Beispiel #5
0
def _try_to_close_or_open_us_when_create_or_edit_task(instance):
    from taiga.projects.userstories import services as us_service

    if instance.user_story_id:
        if us_service.calculate_userstory_is_closed(instance.user_story):
            us_service.close_userstory(instance.user_story)
        else:
            us_service.open_userstory(instance.user_story)

    if instance.prev and instance.prev.user_story_id and instance.prev.user_story_id != instance.user_story_id:
        if us_service.calculate_userstory_is_closed(instance.prev.user_story):
            us_service.close_userstory(instance.prev.user_story)
        else:
            us_service.open_userstory(instance.prev.user_story)