TT#121955 build: remove module models

Change-Id: I4bc608f5c84359c155895935a3b77c24ba0f44c0
pull/5/head
Victor Seva 4 years ago
parent 8da6c9cb48
commit b4a4e72cc6

@ -18,7 +18,7 @@ from django.core.management.base import BaseCommand
from django.core.management.base import CommandError from django.core.management.base import CommandError
from build.models import BuildRelease from build.models import BuildRelease
from build.models.br import regex_mrXX from build.models import regex_mrXX
from build.utils import ReleaseConfig from build.utils import ReleaseConfig

@ -21,10 +21,10 @@ from django.db.models import Q
from django.forms.models import model_to_dict from django.forms.models import model_to_dict
from django.utils import timezone from django.utils import timezone
from ..conf import settings from .conf import settings
from build.exceptions import BuildReleaseUnique from .exceptions import BuildReleaseUnique
from build.utils import get_simple_release from .utils import get_simple_release
from build.utils import ReleaseConfig from .utils import ReleaseConfig
from repoapi.models import JenkinsBuildInfo from repoapi.models import JenkinsBuildInfo
logger = structlog.get_logger(__name__) logger = structlog.get_logger(__name__)
@ -154,7 +154,7 @@ class BuildRelease(models.Model):
def resume(self): def resume(self):
if not self.done: if not self.done:
from build.tasks import build_resume from .tasks import build_resume
build_resume.delay(self.id) build_resume.delay(self.id)

@ -1,16 +0,0 @@
# Copyright (C) 2017-2022 The Sipwise Team - http://sipwise.com
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
from .br import BuildRelease # noqa
from repoapi.models import JenkinsBuildInfo # noqa

@ -20,10 +20,9 @@ from django.dispatch import receiver
from django.utils import timezone from django.utils import timezone
from .conf import settings from .conf import settings
from .models.br import BuildRelease from .models import BuildRelease
from build.tasks import build_release from .tasks import build_release
from build.tasks import build_resume from .tasks import build_resume
from repoapi.models import JenkinsBuildInfo
logger = structlog.get_logger(__name__) logger = structlog.get_logger(__name__)
@ -46,7 +45,11 @@ def br_manage(sender, **kwargs):
logger.debug("BuildRelease:%s triggered", instance) logger.debug("BuildRelease:%s triggered", instance)
@receiver(post_save, sender=JenkinsBuildInfo, dispatch_uid="build_jbi_manage") @receiver(
post_save,
sender="repoapi.JenkinsBuildInfo",
dispatch_uid="build_jbi_manage",
)
def jbi_manage(sender, **kwargs): def jbi_manage(sender, **kwargs):
if not kwargs["created"]: if not kwargs["created"]:
return return

@ -16,9 +16,9 @@ import structlog
from celery import shared_task from celery import shared_task
from .conf import settings from .conf import settings
from build.models.br import BuildRelease from .models import BuildRelease
from build.utils import trigger_build from .utils import trigger_build
from build.utils import trigger_copy_deps from .utils import trigger_copy_deps
from repoapi.celery import app from repoapi.celery import app
logger = structlog.get_logger(__name__) logger = structlog.get_logger(__name__)

Loading…
Cancel
Save