Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix accidentaly messed up return type default_location getter #848

Merged
merged 3 commits into from
Feb 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cozy/model/settings.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import logging
from typing import NoReturn

import peewee

import cozy.ext.inject as inject
from peewee import SqliteDatabase

import cozy.ext.inject as inject
from cozy.db.book import Book
from cozy.db.settings import Settings as SettingsModel
from cozy.db.storage import Storage as StorageModel
from cozy.model.storage import Storage, InvalidPath
from cozy.model.storage import InvalidPath, Storage
from cozy.report import reporter

log = logging.getLogger("model.storage_location")
Expand Down Expand Up @@ -47,11 +47,11 @@ def last_played_book(self, new_value):
self._db_object.save(only=self._db_object.dirty_fields)

@property
def default_location(self) -> bool:
def default_location(self) -> Storage | NoReturn:
for location in self.storage_locations:
if location.default:
return True
return False
return location
assert False, "this should never happen"
rdbende marked this conversation as resolved.
Show resolved Hide resolved

@property
def storage_locations(self) -> list[Storage]:
Expand Down