mirror of
https://github.com/ansible/awx.git
synced 2026-01-22 06:58:06 -03:30
Clean up flake8 related issues
This commit is contained in:
parent
4b1493f456
commit
41d5393af0
@ -2108,7 +2108,7 @@ class NotifierSerializer(BaseSerializer):
|
||||
if incorrect_type_fields:
|
||||
for type_field_error in incorrect_type_fields:
|
||||
error_list.append("Configuration field '{}' incorrect type, expected {}".format(type_field_error[0],
|
||||
type_field_error[1]))
|
||||
type_field_error[1]))
|
||||
if error_list:
|
||||
raise serializers.ValidationError(error_list)
|
||||
return attrs
|
||||
|
||||
@ -104,7 +104,7 @@ class Notifier(CommonModel):
|
||||
|
||||
def send(self, subject, body):
|
||||
for field in filter(lambda x: self.notification_class.init_parameters[x]['type'] == "password",
|
||||
self.notification_class.init_parameters):
|
||||
self.notification_class.init_parameters):
|
||||
self.notification_configuration[field] = decrypt_field(self,
|
||||
'notification_configuration',
|
||||
subfield=field)
|
||||
|
||||
@ -10,7 +10,6 @@ import urlparse
|
||||
# Django
|
||||
from django.conf import settings
|
||||
from django.db import models
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.utils.encoding import smart_str, smart_text
|
||||
from django.core.exceptions import ValidationError
|
||||
|
||||
@ -30,7 +30,6 @@ from djcelery.models import TaskMeta
|
||||
# AWX
|
||||
from awx.main.models.base import * # noqa
|
||||
from awx.main.models.schedules import Schedule
|
||||
from awx.main.models.notifications import Notification
|
||||
from awx.main.utils import decrypt_field, emit_websocket_notification, _inventory_updates
|
||||
from awx.main.redact import UriCleaner
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
# Copyright (c) 2016 Ansible, Inc.
|
||||
# All Rights Reserved.
|
||||
|
||||
import logging
|
||||
import pprint
|
||||
|
||||
from django.utils.encoding import smart_text
|
||||
from django.core.mail.backends.smtp import EmailBackend
|
||||
|
||||
@ -88,7 +88,7 @@ class IrcBackend(TowerBaseEmailBackend):
|
||||
self.connection.add_global_handler("join", self.on_join)
|
||||
start_time = time.time()
|
||||
process_time = time.time()
|
||||
while self.channels_sent < len(self.channels) and (process_time-start_time) < 60:
|
||||
while self.channels_sent < len(self.channels) and (process_time - start_time) < 60:
|
||||
self.reactor.process_once(0.1)
|
||||
process_time = time.time()
|
||||
self.reactor.disconnect_all()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user