Changeset 3314 for WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
- Timestamp:
- 10 Mar 2008, 19:12:40 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/base/skins/waeup_upload/uploads_index.py
r3313 r3314 29 29 30 30 path_info = request.get('PATH_INFO').split('/') 31 NO_KEY = '----'32 31 info = {} 33 32 info['action'] = "%s" % context.absolute_url() … … 47 46 msg, invalid_keys = doc['checkKeys']() 48 47 new_keys = [] 49 for keyin invalid_keys:50 id_key = "%s|%s" % (short_id, key)48 for old_key,previous,value in invalid_keys: 49 id_key = "%s|%s" % (short_id,old_key) 51 50 if request.form.has_key(id_key): 52 51 new_key = request.form.get(id_key)['valid_key'] 53 if new_key != NO_KEY:54 new_keys += ( key,new_key),52 if new_key != old_key and new_key != doc.NO_KEY: 53 new_keys += (old_key,new_key), 55 54 if new_keys: 56 55 doc.editHeadline(new_keys) 57 56 for key in new_keys: 58 57 logger.info('%s changed column heading in file %s from %s to %s' % (member,long_id,key[0],key[1])) 58 return request.RESPONSE.redirect(context.absolute_url()) 59 59 60 60 wrong = [] … … 66 66 doc = upload.getContent() 67 67 row['valid_keys'] = doc['getKeys']() 68 row['valid_keys'][0 ] = NO_KEY68 row['valid_keys'][0:0] = doc.NO_KEY, 69 69 row['id'] = id.replace('.csv','') 70 70 row['title'] = doc.filename … … 75 75 if import_message: 76 76 row['imported'] = True 77 row['imported_by'] = getattr('doc','imported_by','') 77 78 row['msg'] = import_message 78 79 if getattr(doc,'import_date',''): … … 83 84 else: 84 85 row['msg'],row['invalid_keys'] = doc['checkKeys']() 85 if not row['msg'] and not row['invalid_keys']:86 if not (request.has_key('goto_edit') and id in ids) and not row['msg']: 86 87 add_to = importable 87 88 row['filename'] = doc.filename 88 89 row['import_layout'] = doc.import_layout 90 row['uploaded_by'] = doc.uploaded_by 89 91 row['upload_date'] = doc.upload_date.strftime("%d/%m/%y %H:%M:%S") 90 row['uploaded_by'] = doc.uploaded_by91 92 row['imported_by'] = doc.imported_by 92 93 add_to.append(row)
Note: See TracChangeset for help on using the changeset viewer.