Skip to content

Commit

Permalink
Flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vipulchhabra99 committed Feb 18, 2021
1 parent 63d897f commit 8c93196
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions foca/foca.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ def foca(config: Optional[str] = None) -> App:
logger.info(f"Error handler registered.")

# Enable cross-origin resource sharing
if(conf.security.cors.enabled == True):
if(conf.security.cors.enabled is True):
enable_cors(cnx_app.app)
logger.info(f"CORS enabled.")
else:

if(conf.security.cors.enabled is False):
logger.info(f"CORS disabled")

# Register OpenAPI specs
Expand Down
2 changes: 2 additions & 0 deletions foca/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ class AuthConfig(FOCABaseConfig):
]
validation_checks: ValidationChecksEnum = ValidationChecksEnum.all


class CORSConfig(FOCABaseConfig):
"""Model for Cross Origin Resource Sharing configuration.
Expand All @@ -725,6 +726,7 @@ class CORSConfig(FOCABaseConfig):
"""
enabled: bool = True


class SecurityConfig(FOCABaseConfig):
"""Model for list the Security configuration.
Expand Down

0 comments on commit 8c93196

Please sign in to comment.