Changeset 1724 in main for branches


Ignore:
Timestamp:
11/07/12 15:19:04 (7 years ago)
Author:
pcosquer
Message:

branch 1.1: merge [1722] and [1723] from trunk

Location:
branches/1.1/openPLM
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1/openPLM

  • branches/1.1/openPLM/apps/document3D/models.py

    r1704 r1724  
    234234                if tempfile_size: 
    235235                    filename = new_STP_file.filename 
    236                     path = docfs.get_available_name(filename) 
     236                    path = docfs.get_available_name(filename.encode("utf-8")) 
    237237                    shutil.copy(tempfile_size[0].name, docfs.path(path)) 
    238238                    new_doc = DocumentFile.objects.create(file=path, 
     
    306306                else: 
    307307                    self._stps = DocumentFile.objects.none().values_list("id", flat=True) 
    308             q = Q(stp=doc_file) | Q(stp__in=self._stps) 
     308            q = Q(stp=doc_file) 
     309            stps = list(self._stps) 
     310            if stps: 
     311                q |= Q(stp__in=stps) 
    309312            gfs = GeometryFile.objects.filter(q) 
    310313        else: 
     
    669672        old_product=Product_from_Arb(json.loads(old_arbre)) # doc_id and doc_path original 
    670673        new_stp_file=DocumentFile() 
    671         name = new_stp_file.file.storage.get_available_name(product.name+".stp".encode("utf-8")) 
     674        name = new_stp_file.file.storage.get_available_name((product.name+".stp").encode("utf-8")) 
    672675        new_stp_path = os.path.join(new_stp_file.file.storage.location, name) 
    673676        f = File(open(new_stp_path, 'w')) 
Note: See TracChangeset for help on using the changeset viewer.