Changeset 404 in main


Ignore:
Timestamp:
10/18/11 13:40:21 (8 years ago)
Author:
pcosquer
Message:

import csv: add the username to the tempory filename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/openPLM/plmapp/views/main.py

    r403 r404  
    11111111        if csv_form.is_valid(): 
    11121112            f = request.FILES["file"] 
    1113             prefix = "openplmcsv" 
     1113            prefix = "openplmcsv" + request.user.username 
    11141114            tmp = tempfile.NamedTemporaryFile(prefix=prefix, delete=False) 
    11151115            for chunk in f.chunks(): 
     
    11311131    ctx["io_error"] = False 
    11321132    try: 
    1133         path = os.path.join(tempfile.gettempdir(), "openplmcsv" +  filename) 
     1133        path = os.path.join(tempfile.gettempdir(), 
     1134                            "openplmcsv" + request.user.username + filename) 
    11341135        with open(path, "rb") as csv_file: 
    11351136            preview = csvimport.CSVPreview(csv_file, encoding) 
Note: See TracChangeset for help on using the changeset viewer.