Divide some long lines

remotes/origin/enhancement/email-actions
David Barragán Merino 2015-07-09 13:56:28 +02:00
parent 9d54dc63b5
commit 4df5224259
1 changed files with 10 additions and 5 deletions

View File

@ -21,12 +21,15 @@ from taiga.projects.history import services as history_services
from taiga.projects.models import Project from taiga.projects.models import Project
from taiga.users.models import User from taiga.users.models import User
from taiga.projects.history.choices import HistoryType from taiga.projects.history.choices import HistoryType
from taiga.timeline.service import (push_to_timeline, build_user_namespace, from taiga.timeline.service import (push_to_timeline,
build_project_namespace, extract_user_info) build_user_namespace,
build_project_namespace,
extract_user_info)
# TODO: Add events to followers timeline when followers are implemented. # TODO: Add events to followers timeline when followers are implemented.
# TODO: Add events to project watchers timeline when project watchers are implemented. # TODO: Add events to project watchers timeline when project watchers are implemented.
def _push_to_timeline(*args, **kwargs): def _push_to_timeline(*args, **kwargs):
if settings.CELERY_ENABLED: if settings.CELERY_ENABLED:
push_to_timeline.delay(*args, **kwargs) push_to_timeline.delay(*args, **kwargs)
@ -69,8 +72,6 @@ def _push_to_timelines(project, user, obj, event_type, created_datetime, extra_d
namespace=build_user_namespace(user), namespace=build_user_namespace(user),
extra_data=extra_data) extra_data=extra_data)
#Related people: team members
def on_new_history_entry(sender, instance, created, **kwargs): def on_new_history_entry(sender, instance, created, **kwargs):
if instance._importing: if instance._importing:
@ -125,7 +126,11 @@ def create_membership_push_to_timeline(sender, instance, **kwargs):
_push_to_timelines(instance.project, instance.user, instance, "create", created_datetime) _push_to_timelines(instance.project, instance.user, instance, "create", created_datetime)
# If we are updating the old user is removed from project # If we are updating the old user is removed from project
if prev_instance.user: if prev_instance.user:
_push_to_timelines(instance.project, prev_instance.user, prev_instance, "delete", created_datetime) _push_to_timelines(instance.project,
prev_instance.user,
prev_instance,
"delete",
created_datetime)
def delete_membership_push_to_timeline(sender, instance, **kwargs): def delete_membership_push_to_timeline(sender, instance, **kwargs):