bugfix - when using the legacy form 'sfi add <file>',
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 30 May 2012 07:50:23 +0000 (09:50 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 30 May 2012 07:50:23 +0000 (09:50 +0200)
no options are provided at all

sfa/client/sfi.py

index 9cf6551..b9202e2 100644 (file)
@@ -189,7 +189,7 @@ def load_record_from_opts(options):
         record_dict['pi'] = options.pis
 
     # fill in the blanks
-    if record_dict['type'] == 'user':
+    if 'type' in record_dict and record_dict['type'] == 'user':
         if not 'first_name' in record_dict:
             record_dict['first_name'] = record_dict['hrn']
         if 'last_name' not in record_dict: