Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar_network/db/routes.py
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@sugarlabs.org>2013-08-09 05:37:50 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2013-08-09 05:37:50 (GMT)
commit6a59ba5d31c15fabc28b3a2fb1aeab0e1991468e (patch)
tree9c379d9e3160fe25f37f48b4ecaef9a1c583d557 /sugar_network/db/routes.py
parent3917eb055920d878a1a21f8f5170baffb44c39fa (diff)
Create context while uploading initial implementation
Diffstat (limited to 'sugar_network/db/routes.py')
-rw-r--r--sugar_network/db/routes.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/sugar_network/db/routes.py b/sugar_network/db/routes.py
index e61199a..5706587 100644
--- a/sugar_network/db/routes.py
+++ b/sugar_network/db/routes.py
@@ -215,14 +215,13 @@ class Routes(object):
else access)
if value is None:
value = {'blob': None}
- elif isinstance(value, dict):
- enforce('url' in value,
- 'Key %r is not specified in %r blob property',
- 'url', name)
- value = {'url': value['url']}
- else:
+ elif isinstance(value, basestring) or hasattr(value, 'read'):
value = _read_blob(request, prop, value)
blobs.append(value['blob'])
+ elif isinstance(value, dict):
+ enforce('url' in value or 'blob' in value, 'No bundle')
+ else:
+ raise RuntimeError('Incorrect BLOB value')
else:
prop.assert_access(access)
if prop.localized and isinstance(value, basestring):