Commit 13940825 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

flake8, isort

parent 7811880c
......@@ -5,6 +5,8 @@ EXPOSE 8000
RUN mkdir /app
WORKDIR /app
RUN apk update && apk add --no-cache git
ADD requirements.txt manage.py ./
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir -U https://github.com/jieter/django-tables2/archive/template-makeover.zip
......
......@@ -4,7 +4,7 @@ services:
app:
build: .
volumes:
- ./db.sqlite3:./db.sqlite3
- ./db.sqlite3:/app/db.sqlite3
- /srv/dashboard/repositories:/srv/dashboard/repositories
- /srv/dashboard/robotpkg:/srv/dashboard/robotpkg
ports:
......
......@@ -3,7 +3,7 @@ from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
from rainboard.models import Image
logger = logging.getLogger('rainboard.docker')
......
......@@ -3,7 +3,7 @@ from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
from rainboard.models import Image
logger = logging.getLogger('rainboard.docker')
......@@ -14,4 +14,4 @@ class Command(BaseCommand):
def handle(self, *args, **options):
logger.info('Pulling all docker images…')
for image in Image.objects.all():
ret = call(image.pull())
call(image.pull())
......@@ -3,7 +3,7 @@ from subprocess import call
from django.core.management.base import BaseCommand
from rainboard.models import Image, Robotpkg
from rainboard.models import Image
logger = logging.getLogger('rainboard.docker')
......@@ -14,4 +14,4 @@ class Command(BaseCommand):
def handle(self, *args, **options):
logger.info('Pushing all docker images…')
for image in Image.objects.all():
ret = call(image.push())
call(image.push())
......@@ -21,7 +21,8 @@ class Command(BaseCommand):
for project in Project.objects.all():
for slug in [project.slug, project.slug.replace('_', '-')]:
for pkg in path.glob(f'*/{slug}'):
obj, created = Robotpkg.objects.get_or_create(name=pkg.name, category=pkg.parent.name, project=project)
obj, created = Robotpkg.objects.get_or_create(name=pkg.name, category=pkg.parent.name,
project=project)
if created:
logger.info(f'{project} found in {pkg}')
obj.update(pull=False)
# Generated by Django 2.0.2 on 2018-02-12 15:41
from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
......
# Generated by Django 2.0.2 on 2018-02-15 18:19
from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
......
import json
import logging
import re
from subprocess import check_output, CalledProcessError
from subprocess import CalledProcessError, check_output
from django.conf import settings
from django.db import models
......@@ -15,7 +15,7 @@ from autoslug import AutoSlugField
from ndh.models import Links, NamedModel, TimeStampedModel
from ndh.utils import enum_to_choices, query_sum
from .utils import SOURCES, TARGETS, api_next, slugify_with_dots, invalid_mail
from .utils import SOURCES, TARGETS, api_next, invalid_mail, slugify_with_dots
logger = logging.getLogger('rainboard.models')
......@@ -675,7 +675,6 @@ class Contributor(models.Model):
return ', '.join(str(project) for project in self.projects.all())
class ContributorName(models.Model):
contributor = models.ForeignKey(Contributor, on_delete=models.CASCADE, blank=True, null=True)
name = models.CharField(max_length=200, unique=True)
......
from django.views.generic import CreateView, DetailView
from django.views.generic import DetailView
from django_filters.views import FilterView
from django_tables2 import RequestConfig
from django_tables2.views import SingleTableMixin, SingleTableView
from . import models, tables, filters
from . import filters, models, tables
class ForgesView(SingleTableView):
......@@ -68,6 +68,7 @@ class ProjectContributorsView(ProjectTableView):
def get_object_list(self):
return self.object.contributors()
class ProjectGitlabView(ProjectView):
template_name = 'rainboard/gitlab-ci.yml'
content_type = 'application/x-yaml'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment