Commits

Matthew Turk committed 0646def

A few minor fixes.

  • Participants
  • Parent commits 99b5ebd

Comments (0)

Files changed (4)

File ythub/templates/mapserver.html

 </script>
 </HEAD>
 <BODY>
-  <DIV id="map" style="height: 511px; width: 511px;"></div>
+  <DIV id="map"></div>
 </BODY>
 </HTML>

File ythub/templates/vertices.html

     // .. make it transparent
     galaxy00.setOpacity(0.3);
     galaxy00.setColor(0.4,0.1,0.3);
+    examine = {gal: galaxy00, r: r};
 
     // add the object
     r.add(galaxy00);

File ythub/uploader.py

 from tempfile import TemporaryFile
 from flask import jsonify
-#from ythub.models import model_registry
+from ythub.models import view_proxies
 from ythub.database import db_session, sdb, bucket
 from yt.mods import *
 import uuid
 
 class UploadHandler(object):
     def __init__(self, chunk_data, metadata):
+        if metadata['obj_type'] not in view_proxies:
+            raise KeyError
         self.metadata = metadata
         self.chunk_data = chunk_data
         # Metadata has to tell me a bit about the chunks

File ythub/views.py

     metadata = json.loads(request.form['metadata'])
     print "UPLOAD STARTED FOR", user_id
     metadata['user_id'] = user_id
-    container['uploader_%s' % uu] = UploadHandler(chunk_data, metadata)
+    try:
+        container['uploader_%s' % uu] = UploadHandler(chunk_data, metadata)
+    except KeyError:
+        return make_response("Unknown datatype %s" % (metadata['obj_type']))
     return jsonify(handler_uuid = uu, chunk_size = CHUNK_SIZE)
 
 @app.route("/upload/handler/<handler_uuid>", methods=["POST", "GET"])