Changeset 454 in main


Ignore:
Timestamp:
11/05/11 10:37:47 (8 years ago)
Author:
pcosquer
Message:

controller:document: fix an error if an user revise a document
with a file which has a thumbnail added through the admin interface

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/controllers/document.py

    r430 r454  
    284284                ext = os.path.splitext(doc_file.thumbnail.path)[1] 
    285285                thumb = "%d%s" %(new_doc.id, ext) 
    286                 thumb_path = re.sub(r"/\d+_.*%s$" % ext, "/" + thumb, 
    287                                     doc_file.thumbnail.path) 
     286                dirname = os.path.dirname(doc_file.thumbnail.path) 
     287                thumb_path = os.path.join(dirname, thumb) 
    288288                shutil.copy(doc_file.thumbnail.path, thumb_path) 
    289289                new_doc.thumbnail = os.path.basename(thumb_path) 
Note: See TracChangeset for help on using the changeset viewer.