Limit bookmark editing to saveable bookmarks.
This commit is contained in:
parent
c5b0187a8f
commit
3ab19d5f37
|
|
@ -118,6 +118,10 @@ class Bookmarks(object):
|
||||||
logger.exception("error while processing bookmarks from %s", file)
|
logger.exception("error while processing bookmarks from %s", file)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
def getEditableBookmarks(self):
|
||||||
|
self._refresh()
|
||||||
|
return [b for b in self.bookmarks if b.srcFile is None]
|
||||||
|
|
||||||
def getBookmarks(self, range=None):
|
def getBookmarks(self, range=None):
|
||||||
self._refresh()
|
self._refresh()
|
||||||
if range is None:
|
if range is None:
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
|
||||||
return variables
|
return variables
|
||||||
|
|
||||||
def render_table(self):
|
def render_table(self):
|
||||||
bookmarks = Bookmarks.getSharedInstance().getBookmarks()
|
bookmarks = Bookmarks.getSharedInstance().getEditableBookmarks()
|
||||||
emptyText = """
|
emptyText = """
|
||||||
<tr class="emptytext"><td colspan="4">
|
<tr class="emptytext"><td colspan="4">
|
||||||
No bookmarks in storage. You can add new bookmarks using the buttons below.
|
No bookmarks in storage. You can add new bookmarks using the buttons below.
|
||||||
|
|
@ -86,7 +86,7 @@ class BookmarksController(AuthorizationMixin, BreadcrumbMixin, WebpageController
|
||||||
def _findBookmark(self, bookmark_id):
|
def _findBookmark(self, bookmark_id):
|
||||||
bookmarks = Bookmarks.getSharedInstance()
|
bookmarks = Bookmarks.getSharedInstance()
|
||||||
try:
|
try:
|
||||||
return next(b for b in bookmarks.getBookmarks() if id(b) == bookmark_id)
|
return next(b for b in bookmarks.getEditableBookmarks() if id(b) == bookmark_id)
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue