Commit 3771788f authored by Guilhem Saurel's avatar Guilhem Saurel

yapf

parent 8d6bcaa4
Pipeline #3783 failed with stage
in 44 seconds
......@@ -8,8 +8,8 @@ variables:
format:
image: eur0c.laas.fr:5000/gepetto/buildfarm/format
script:
- isort -c
- flake8 .
- yapf -dr .
build:
image: docker
......
*/migrations
......@@ -149,9 +149,7 @@ LOGGING = {
}
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': (
'django_filters.rest_framework.DjangoFilterBackend',
),
'DEFAULT_FILTER_BACKENDS': ('django_filters.rest_framework.DjangoFilterBackend', ),
}
DJANGO_TABLES2_TEMPLATE = 'rainboard/tables.html'
......
......@@ -7,4 +7,5 @@ urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^accounts/', include('django.contrib.auth.urls')),
url(r'', include('rainboard.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
] + static(
settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
......@@ -10,9 +10,7 @@ if __name__ == "__main__":
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
raise ImportError("Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?") from exc
execute_from_command_line(sys.argv)
import logging
import requests
from django.core.management import call_command
from django.core.management.base import BaseCommand
from rainboard.models import Forge, License, Repo
LICENSES = 'https://raw.githubusercontent.com/spdx/license-list-data/master/json/licenses.json'
......@@ -16,8 +16,11 @@ class Command(BaseCommand):
def handle(self, *args, **options):
logger.info(f'updating licenses')
for data in requests.get(LICENSES).json()['licenses']:
License.objects.get_or_create(spdx_id=data['licenseId'],
defaults={'name': data['name'], 'url': data['detailsUrl']})
License.objects.get_or_create(
spdx_id=data['licenseId'], defaults={
'name': data['name'],
'url': data['detailsUrl']
})
logger.info(f'updating forges')
for forge in Forge.objects.order_by('source'):
......
......@@ -2,6 +2,7 @@ from django.conf import settings
from django.core.management import call_command
from django.core.management.base import BaseCommand
from django.db.models import F, Q
from rainboard.models import Branch, Forge, Project, Repo, Robotpkg
from rainboard.utils import SOURCES, update_robotpkg
......@@ -43,9 +44,9 @@ class Command(BaseCommand):
log(f'\nUpdating keep doc\n')
Branch.objects.filter(
Q(name__endswith='master') | Q(name__endswith='devel'),
repo__namespace=F('project__main_namespace'), repo__forge__source=SOURCES.gitlab
).update(keep_doc=True)
Q(name__endswith='master') | Q(name__endswith='devel'),
repo__namespace=F('project__main_namespace'),
repo__forge__source=SOURCES.gitlab).update(keep_doc=True)
log(f'\nDelet perso\n')
call_command('delete_perso')
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