diff --git a/hotfix/models.py b/hotfix/models.py index 220e2b6..28d5271 100644 --- a/hotfix/models.py +++ b/hotfix/models.py @@ -16,8 +16,6 @@ import logging import re from django.db import models -from django.db.models.signals import post_save -from django.conf import settings logger = logging.getLogger(__name__) workfront_re = re.compile(r"TT#(\d+)") diff --git a/hotfix/tasks.py b/hotfix/tasks.py index 566c4a9..af0c039 100644 --- a/hotfix/tasks.py +++ b/hotfix/tasks.py @@ -16,9 +16,8 @@ from __future__ import absolute_import import logging from celery import shared_task -from django.conf import settings -from .utils import parse_changelog, create_note from repoapi.models import JenkinsBuildInfo +from .utils import parse_changelog, create_note logger = logging.getLogger(__name__) diff --git a/hotfix/test/test_hotfix_released.py b/hotfix/test/test_hotfix_released.py index 4a7bc99..229b861 100644 --- a/hotfix/test/test_hotfix_released.py +++ b/hotfix/test/test_hotfix_released.py @@ -13,11 +13,7 @@ # You should have received a copy of the GNU General Public License along # with this program. If not, see . -import os -import shutil - from django.test import TestCase, override_settings -from django.conf import settings from mock import patch, call, mock_open from hotfix import tasks, utils, models from repoapi.models import JenkinsBuildInfo diff --git a/hotfix/utils.py b/hotfix/utils.py index 9fa5262..4c87cab 100644 --- a/hotfix/utils.py +++ b/hotfix/utils.py @@ -15,8 +15,8 @@ from __future__ import absolute_import import logging from debian.changelog import Changelog -from .models import WorkfrontNoteInfo from repoapi import utils +from .models import WorkfrontNoteInfo logger = logging.getLogger(__name__) @@ -40,5 +40,5 @@ def create_note(wid, projectname, version): projectname=projectname, version=version) if created: - msg = "hotfix %s %s triggered" % (projectname, version) + msg = "hotfix %s %s triggered" % (note.projectname, note.version) utils.workfront_note_send(wid, msg) diff --git a/panel/views.py b/panel/views.py index efbea5b..2a40b16 100644 --- a/panel/views.py +++ b/panel/views.py @@ -35,13 +35,13 @@ def release(request, _release): def project(request, _release, _project): if jbi.objects.is_project(_release, _project): - latest_uuid = jbi.objects.latest_uuid_js(_release, _project) + _latest_uuid = jbi.objects.latest_uuid_js(_release, _project) uuids = jbi.objects.release_project_uuids_set(_release, _project) context = { 'project': _project, 'release': _release, 'uuids': uuids, - 'latest_uuid': latest_uuid} + 'latest_uuid': _latest_uuid} return render(request, 'panel/project.html', context) else: return HttpResponseNotFound('project {} not found'.format(_project)) @@ -49,12 +49,12 @@ def project(request, _release, _project): def uuid(request, _release, _project, _uuid): if jbi.objects.is_uuid(_release, _project, _uuid): - latest_uuid = jbi.objects.is_latest_uuid_js(_release, _project, _uuid) + _latest_uuid = jbi.objects.is_latest_uuid_js(_release, _project, _uuid) context = { 'project': _project, 'release': _release, 'uuid': _uuid, - 'latest_uuid': latest_uuid, + 'latest_uuid': _latest_uuid, } return render(request, 'panel/project_uuid.html', context) else: @@ -63,13 +63,13 @@ def uuid(request, _release, _project, _uuid): def latest_uuid(request, _release, _project): if jbi.objects.is_project(_release, _project): - latest_uuid = jbi.objects.latest_uuid_js(_release, _project) - if latest_uuid is not None: + _latest_uuid = jbi.objects.latest_uuid_js(_release, _project) + if _latest_uuid is not None: context = { 'project': _project, 'release': _release, - 'uuid': latest_uuid['tag'], - 'latest_uuid': latest_uuid, + 'uuid': _latest_uuid['tag'], + 'latest_uuid': _latest_uuid, } return render(request, 'panel/project_uuid.html', context) else: