From a7af114590bfb4a6d2f125610c2c755339f993a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Fri, 5 Mar 2010 03:07:10 +0100 Subject: Save current search type in session --- portato/db/database.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'portato/db') diff --git a/portato/db/database.py b/portato/db/database.py index 8e10a40..c4ab680 100644 --- a/portato/db/database.py +++ b/portato/db/database.py @@ -14,7 +14,7 @@ from __future__ import absolute_import, with_statement from threading import RLock from functools import wraps -from ..helper import error +from ..helper import warning class UnsupportedSearchTypeError(Exception): pass @@ -74,8 +74,7 @@ class Database (object): raise NotImplentedError def set_type (self, type): - if type & self.search_types() == 0: - error("Search type %s not supported by database '%s'.", type, self.__class__.__name__) + if type & self.search_types() != type: raise UnsupportedSearchTypeError, type self._type = type -- cgit v1.2.3