Skip to content

Commit

Permalink
Blackify
Browse files Browse the repository at this point in the history
  • Loading branch information
Mehdi Abaakouk committed Sep 11, 2019
1 parent 03d13a0 commit e99ddbf
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 37 deletions.
8 changes: 5 additions & 3 deletions wazo_dird/database/schemas.py
Expand Up @@ -26,7 +26,10 @@ class DisplaySchema(BaseSchema):
tenant_uuid = fields.UUID(dump_only=True)
name = fields.String(validate=Length(min=1, max=512), required=True)
columns = fields.Nested(
DisplayColumnSchema, many=True, required=True, validate=Length(min=1),
DisplayColumnSchema,
many=True,
required=True,
validate=Length(min=1),
unknown=marshmallow.EXCLUDE,
)

Expand Down Expand Up @@ -61,5 +64,4 @@ class ProfileSchema(BaseSchema):
tenant_uuid = fields.UUID(dump_only=True)
name = fields.String()
display = fields.Nested(DisplaySchema)
services = ServiceDictSchema(BaseSchema, required=True,
unknown=marshmallow.EXCLUDE)
services = ServiceDictSchema(BaseSchema, required=True, unknown=marshmallow.EXCLUDE)
8 changes: 2 additions & 6 deletions wazo_dird/plugins/conference_backend/schemas.py
Expand Up @@ -60,13 +60,9 @@ class ListSchema(_ListSchema):


class SourceSchema(BaseSourceSchema):
auth = fields.Nested(
AuthConfigSchema,
missing=lambda: AuthConfigSchema().load({})
)
auth = fields.Nested(AuthConfigSchema, missing=lambda: AuthConfigSchema().load({}))
confd = fields.Nested(
ConfdConfigSchema,
missing=lambda: ConfdConfigSchema().load({})
ConfdConfigSchema, missing=lambda: ConfdConfigSchema().load({})
)


Expand Down
3 changes: 1 addition & 2 deletions wazo_dird/plugins/google_backend/schemas.py
Expand Up @@ -9,8 +9,7 @@
class SourceSchema(BaseSourceSchema):

auth = fields.Nested(
BaseAuthConfigSchema,
missing=lambda: BaseAuthConfigSchema().load({})
BaseAuthConfigSchema, missing=lambda: BaseAuthConfigSchema().load({})
)


Expand Down
8 changes: 2 additions & 6 deletions wazo_dird/plugins/office365_backend/schemas.py
Expand Up @@ -3,10 +3,7 @@


from xivo.mallow_helpers import ListSchema as _ListSchema
from wazo_dird.schemas import (
BaseAuthConfigSchema,
BaseSourceSchema,
)
from wazo_dird.schemas import BaseAuthConfigSchema, BaseSourceSchema
from xivo.mallow import fields

from xivo.mallow.validate import Length
Expand All @@ -15,8 +12,7 @@
class SourceSchema(BaseSourceSchema):

auth = fields.Nested(
BaseAuthConfigSchema,
missing=lambda: BaseAuthConfigSchema().load({})
BaseAuthConfigSchema, missing=lambda: BaseAuthConfigSchema().load({})
)
endpoint = fields.String(
missing='https://graph.microsoft.com/v1.0/me/contacts',
Expand Down
8 changes: 1 addition & 7 deletions wazo_dird/plugins/phonebook_service/plugin.py
Expand Up @@ -3,13 +3,7 @@

import logging

from marshmallow import (
ValidationError,
fields,
Schema,
validate,
pre_load
)
from marshmallow import ValidationError, fields, Schema, validate, pre_load
from unidecode import unidecode

from wazo_dird import BaseServicePlugin
Expand Down
7 changes: 1 addition & 6 deletions wazo_dird/plugins/profiles/schemas.py
Expand Up @@ -13,12 +13,7 @@ class ResourceSchema(BaseSchema):


class ServiceConfigSchema(BaseSchema):
sources = fields.Nested(
ResourceSchema,
many=True,
missing=[],
unknown=EXCLUDE
)
sources = fields.Nested(ResourceSchema, many=True, missing=[], unknown=EXCLUDE)
options = fields.Dict(missing={})


Expand Down
8 changes: 2 additions & 6 deletions wazo_dird/plugins/wazo_user_backend/schemas.py
Expand Up @@ -14,14 +14,10 @@

class SourceSchema(BaseSourceSchema):
auth = fields.Nested(
AuthConfigSchema,
missing=lambda: AuthConfigSchema().load({}),
unknown=EXCLUDE
AuthConfigSchema, missing=lambda: AuthConfigSchema().load({}), unknown=EXCLUDE
)
confd = fields.Nested(
ConfdConfigSchema,
missing=lambda: ConfdConfigSchema().load({}),
unknown=EXCLUDE
ConfdConfigSchema, missing=lambda: ConfdConfigSchema().load({}), unknown=EXCLUDE
)


Expand Down
2 changes: 1 addition & 1 deletion wazo_dird/schemas.py
Expand Up @@ -8,7 +8,7 @@
compat,
pre_load,
utils,
validates_schema
validates_schema,
)
from xivo.mallow import fields
from xivo.mallow.validate import Length, Range, validate_string_dict
Expand Down

0 comments on commit e99ddbf

Please sign in to comment.