Commit 0cc4ef92 authored by Lukas Burgey's avatar Lukas Burgey
Browse files

Lint the code

parent c0173efa
...@@ -2,8 +2,8 @@ from django.conf.urls import url ...@@ -2,8 +2,8 @@ from django.conf.urls import url
from . import views from . import views
URLPATTERNS = [ URLPATTERNS = [
url(r'^state/', views.StateView.as_view()), url(r'^state', views.StateView.as_view()),
url(r'^sshkey/', views.SSHPublicKeyView.as_view()), url(r'^sshkey', views.SSHPublicKeyView.as_view()),
url(r'^deployments/', views.DeploymentView.as_view()), url(r'^deployments', views.DeploymentView.as_view()),
url(r'^delete_user/', views.UserDeletionView.as_view()), url(r'^delete_user', views.UserDeletionView.as_view()),
] ]
...@@ -3,15 +3,17 @@ ...@@ -3,15 +3,17 @@
import json import json
import logging import logging
import pika
from pika.exceptions import ConnectionClosed
from requests.auth import HTTPBasicAuth
from django.contrib.auth.models import AbstractUser, Group from django.contrib.auth.models import AbstractUser, Group
from django.core.cache import cache from django.core.cache import cache
from django.db import models from django.db import models
from django.db.models.signals import post_save from django.db.models.signals import post_save
from django.dispatch import receiver from django.dispatch import receiver
from django_mysql.models import JSONField from django_mysql.models import JSONField
from pika.exceptions import ConnectionClosed
import pika
from requests.auth import HTTPBasicAuth
from .auth.v1.models import OIDCConfig from .auth.v1.models import OIDCConfig
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
...@@ -149,7 +151,6 @@ class RabbitMQInstance(SingletonModel): ...@@ -149,7 +151,6 @@ class RabbitMQInstance(SingletonModel):
) )
channel.close() channel.close()
# PUBLIC API # PUBLIC API
def publish_by_service(self, service, msg): def publish_by_service(self, service, msg):
self._publish( self._publish(
...@@ -219,7 +220,7 @@ class User(AbstractUser): ...@@ -219,7 +220,7 @@ class User(AbstractUser):
# if the user does not exists # if the user does not exists
@classmethod @classmethod
def get_user(cls, userinfo, idp): def get_user(cls, userinfo, idp):
if not 'sub' in userinfo: if 'sub' not in userinfo:
raise Exception('get_user needs a userinfo which contains the users subject') raise Exception('get_user needs a userinfo which contains the users subject')
query_result = cls.objects.filter( query_result = cls.objects.filter(
...@@ -705,7 +706,7 @@ class DeploymentTask(models.Model): ...@@ -705,7 +706,7 @@ class DeploymentTask(models.Model):
return '[DeploymentTask:{}] {}'.format(self, msg) return '[DeploymentTask:{}] {}'.format(self, msg)
def publish(self): def publish(self):
# FIXME mitigating circular dependencies here # mitigating circular dependencies here
from .clientapi.serializers import DeploymentTaskSerializer from .clientapi.serializers import DeploymentTaskSerializer
msg = json.dumps(DeploymentTaskSerializer(self).data) msg = json.dumps(DeploymentTaskSerializer(self).data)
...@@ -723,7 +724,7 @@ class DeploymentTask(models.Model): ...@@ -723,7 +724,7 @@ class DeploymentTask(models.Model):
if not self.task_items.exists(): if not self.task_items.exists():
# finished sends its own message # finished sends its own message
self.finished() self._finished()
else: else:
from .frontend.views import user_state_dict from .frontend.views import user_state_dict
content = { content = {
...@@ -735,7 +736,7 @@ class DeploymentTask(models.Model): ...@@ -735,7 +736,7 @@ class DeploymentTask(models.Model):
) )
# maintenance after all task items are done # maintenance after all task items are done
def finished(self): def _finished(self):
LOGGER.info(self.msg('done')) LOGGER.info(self.msg('done'))
self.delete() self.delete()
......
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