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

yapf

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