diff --git a/lms/djangoapps/teams/api_urls.py b/lms/djangoapps/teams/api_urls.py index 4feafed823..fe952ae17d 100644 --- a/lms/djangoapps/teams/api_urls.py +++ b/lms/djangoapps/teams/api_urls.py @@ -2,6 +2,8 @@ Defines the URL routes for the Team API. """ +from __future__ import absolute_import + from django.conf import settings from django.conf.urls import url diff --git a/lms/djangoapps/teams/models.py b/lms/djangoapps/teams/models.py index 4028fefca9..67cfc6219f 100644 --- a/lms/djangoapps/teams/models.py +++ b/lms/djangoapps/teams/models.py @@ -2,6 +2,8 @@ Django models related to teams functionality. """ +from __future__ import absolute_import + from datetime import datetime from uuid import uuid4 @@ -10,11 +12,14 @@ from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.db import models from django.dispatch import receiver +from django.utils.text import slugify from django.utils.translation import ugettext_lazy from django_countries.fields import CountryField from model_utils import FieldTracker from opaque_keys.edx.django.models import CourseKeyField +from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT +from lms.djangoapps.teams.utils import emit_team_event from openedx.core.djangoapps.django_comment_common.signals import ( comment_created, comment_deleted, @@ -24,14 +29,11 @@ from openedx.core.djangoapps.django_comment_common.signals import ( thread_created, thread_deleted, thread_edited, - thread_voted, thread_followed, thread_unfollowed, + thread_voted ) -from lms.djangoapps.teams import TEAM_DISCUSSION_CONTEXT -from lms.djangoapps.teams.utils import emit_team_event from student.models import CourseEnrollment, LanguageField -from django.utils.text import slugify from .errors import AlreadyOnTeamInCourse, ImmutableMembershipFieldException, NotEnrolledInCourseForTeam @@ -68,7 +70,7 @@ def post_edit_delete_handler(sender, **kwargs): # pylint: disable=unused-argume post. """ post = kwargs['post'] - handle_activity(kwargs['user'], post, long(post.user_id)) + handle_activity(kwargs['user'], post, int(post.user_id)) @receiver(comment_endorsed) @@ -77,7 +79,7 @@ def comment_endorsed_handler(sender, **kwargs): # pylint: disable=unused-argume Update the user's last activity date upon endorsing a comment. """ comment = kwargs['post'] - handle_activity(kwargs['user'], comment, long(comment.thread.user_id)) + handle_activity(kwargs['user'], comment, int(comment.thread.user_id)) def handle_activity(user, post, original_author_id=None): diff --git a/lms/djangoapps/teams/urls.py b/lms/djangoapps/teams/urls.py index f358f4ca84..ba4391a6f1 100644 --- a/lms/djangoapps/teams/urls.py +++ b/lms/djangoapps/teams/urls.py @@ -2,6 +2,8 @@ Defines the URL routes for this app. """ +from __future__ import absolute_import + from django.conf.urls import url from django.contrib.auth.decorators import login_required diff --git a/lms/djangoapps/teams/utils.py b/lms/djangoapps/teams/utils.py index dc576397b5..e116513972 100644 --- a/lms/djangoapps/teams/utils.py +++ b/lms/djangoapps/teams/utils.py @@ -1,6 +1,9 @@ """Utility methods related to teams.""" +from __future__ import absolute_import + from eventtracking import tracker + from track import contexts