aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/db
diff options
context:
space:
mode:
authorSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-25 20:28:19 +0100
committerSebastian Spaeth <Sebastian@SSpaeth.de>2012-12-25 20:28:19 +0100
commit7c029a1f338bd918b80a4ad071ad05180647750f (patch)
tree2c4b8c733e84beb9e69059ca440922791cf46936 /mediagoblin/db
parent953698842532526afdeadaf6697b35ade84d379c (diff)
downloadmediagoblin-7c029a1f338bd918b80a4ad071ad05180647750f.tar.lz
mediagoblin-7c029a1f338bd918b80a4ad071ad05180647750f.tar.xz
mediagoblin-7c029a1f338bd918b80a4ad071ad05180647750f.zip
Remove InvalidId
It was a NoOp in our Non-mongo world. So it is safe to remove. Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Diffstat (limited to 'mediagoblin/db')
-rw-r--r--mediagoblin/db/sql/fake.py10
-rw-r--r--mediagoblin/db/util.py2
2 files changed, 2 insertions, 10 deletions
diff --git a/mediagoblin/db/sql/fake.py b/mediagoblin/db/sql/fake.py
index 0fd0cc41..bb91dbcb 100644
--- a/mediagoblin/db/sql/fake.py
+++ b/mediagoblin/db/sql/fake.py
@@ -24,7 +24,6 @@ Currently:
- ObjectId "class": It's a function mostly doing
int(init_arg) to convert string primary keys into
integer primary keys.
-- InvalidId exception
- DESCENDING "constant"
"""
@@ -32,14 +31,7 @@ Currently:
DESCENDING = object() # a unique object for this "constant"
-class InvalidId(Exception):
- pass
-
-
def ObjectId(value=None):
if value is None:
return None
- try:
- return int(value)
- except ValueError:
- raise InvalidId("%r is an invalid id" % value)
+ return int(value)
diff --git a/mediagoblin/db/util.py b/mediagoblin/db/util.py
index 9fa3b204..f14f79aa 100644
--- a/mediagoblin/db/util.py
+++ b/mediagoblin/db/util.py
@@ -15,6 +15,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#TODO: check now after mongo removal if we can't rip out a layer of abstraction
-from mediagoblin.db.sql.fake import ObjectId, InvalidId, DESCENDING
+from mediagoblin.db.sql.fake import ObjectId, DESCENDING
from mediagoblin.db.sql.util import atomic_update, check_media_slug_used, \
media_entries_for_tag_slug, check_collection_slug_used