Skip to content

Commit

Permalink
Tidy type annotation up
Browse files Browse the repository at this point in the history
as `None` is already defined through `Optional` — cf.
https://docs.python.org/3/library/typing.html#typing.Optional

Signed-off-by: Étienne Boisseau-Sierra <[email protected]>
  • Loading branch information
EBoisseauSierra committed Feb 10, 2022
1 parent 79ccc4f commit ba7da50
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion flask_appbuilder/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def create_db():
@click.option("--path", "-path", help="Specify filepath to export roles to")
@click.option("--indent", help="Specify indent of generated JSON file")
def export_roles(
path: Optional[str] = None, indent: Optional[Union[None, int, str]] = None
path: Optional[str] = None, indent: Optional[Union[int, str]] = None
) -> None:
"""Exports roles with permissions and view menus to JSON file"""
# Cast negative numbers to int (as they're passed as str from CLI)
Expand Down
2 changes: 1 addition & 1 deletion flask_appbuilder/security/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -2024,7 +2024,7 @@ def del_permission_role(self, role, perm_view):
raise NotImplementedError

def export_roles(
self, path: Optional[str] = None, indent: Optional[Union[None, int, str]] = None
self, path: Optional[str] = None, indent: Optional[Union[int, str]] = None
) -> None:
""" Exports roles to JSON file. """
raise NotImplementedError
Expand Down
2 changes: 1 addition & 1 deletion flask_appbuilder/security/mongoengine/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def del_permission_role(self, role, perm_view):
log.error(c.LOGMSG_ERR_SEC_DEL_PERMROLE.format(str(e)))

def export_roles(
self, path: Optional[str] = None, indent: Optional[Union[None, int, str]] = None
self, path: Optional[str] = None, indent: Optional[Union[int, str]] = None
) -> None:
"""Exports roles to JSON file."""
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
Expand Down
2 changes: 1 addition & 1 deletion flask_appbuilder/security/sqla/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def del_permission_role(self, role, perm_view):
self.get_session.rollback()

def export_roles(
self, path: Optional[str] = None, indent: Optional[Union[None, int, str]] = None
self, path: Optional[str] = None, indent: Optional[Union[int, str]] = None
) -> None:
""" Exports roles to JSON file. """
timestamp = datetime.now().strftime("%Y%m%dT%H%M%S")
Expand Down

0 comments on commit ba7da50

Please sign in to comment.