cast memory attributes (originally float) to int
[qcg-portal.git] / qcg / utils.py
index da8f83c..57cf23a 100644 (file)
@@ -155,7 +155,7 @@ def to_form_data(xml):
     desc.xml_description = xml
 
     direct_map = ('env_variables', 'executable', 'arguments', 'note', 'grant', 'hosts', 'properties', 'queue', 'procs',
-                  'wall_time', 'memory', 'memory_per_slot', 'modules', 'input', 'stage_in', 'native', 'persistent')
+                  'wall_time', 'modules', 'input', 'stage_in', 'native', 'persistent')
 
     params = {}
     for name in direct_map:
@@ -193,6 +193,10 @@ def to_form_data(xml):
         else:
             params['postprocess_type'] = JobDescriptionForm.Process.CMD
             params['postprocess_cmd'] = desc.postprocess
+    if desc.memory:
+        params['memory'] = int(desc.memory)
+    if desc.memory_per_slot:
+        params['memory_per_slot'] = int(desc.memory_per_slot)
 
     return params