Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidMStraub committed Dec 10, 2024
1 parent 5801903 commit 7f094a5
Show file tree
Hide file tree
Showing 9 changed files with 72 additions and 62 deletions.
4 changes: 2 additions & 2 deletions gramps_webapi/api/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

from typing import Callable, Optional

import bleach
from bleach.css_sanitizer import CSSSanitizer
import bleach # type: ignore
from bleach.css_sanitizer import CSSSanitizer # type: ignore
from gramps.gen.errors import HandleError
from gramps.gen.lib import Note, NoteType, StyledText
from gramps.plugins.lib.libhtml import Html
Expand Down
2 changes: 1 addition & 1 deletion gramps_webapi/api/media_importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def _identify_missing_files(self) -> MissingFiles:
obj for obj in self.objects if obj.handle not in handles_existing
]

missing_files = {}
missing_files: dict[str, list[dict[str, str]]] = {}
for obj in objects_missing:
if obj.checksum not in missing_files:
missing_files[obj.checksum] = []
Expand Down
4 changes: 2 additions & 2 deletions gramps_webapi/api/resources/bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def _get_bookmarks_object(db_handle: DbReadBase, namespace: str) -> DbBookmarks:
return result


def get_bookmarks(db_handle: DbReadBase, namespace: str) -> Optional[List]:
def get_bookmarks(db_handle: DbReadBase, namespace: str) -> list:
"""Return bookmarks for a namespace."""
bookmarks = _get_bookmarks_object(db_handle, namespace)
return bookmarks.get()
return bookmarks.get() or []


def create_bookmark(db_handle: DbReadBase, namespace: str, handle: str) -> None:
Expand Down
2 changes: 1 addition & 1 deletion gramps_webapi/api/resources/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def delete_all_objects(
db_handle: DbWriteBase,
namespaces: Optional[List[str]] = None,
progress_cb: Optional[Callable] = None,
) -> List[Dict[str, Any]]:
) -> None:
"""Delete all objects, optionally restricting to one or more types (namespaces)."""
if progress_cb:
total = get_total_number_of_objects(db_handle)
Expand Down
2 changes: 1 addition & 1 deletion gramps_webapi/api/resources/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def delete(self, args: Dict, namespace: str, name: str) -> Response:
custom_filters = filters.CustomFilters.get_filters(namespace)
for custom_filter in custom_filters:
if name == custom_filter.get_name():
filter_set = set()
filter_set: set[GenericFilter] = set()
self._find_dependent_filters(namespace, custom_filter, filter_set)
if len(filter_set) > 1:
if "force" not in args or not args["force"]:
Expand Down
Loading

0 comments on commit 7f094a5

Please sign in to comment.