Explorar o código

HUE-7052 [desktop] Retain last_modified when sharing sample docs in sync_documents

krish %!s(int64=8) %!d(string=hai) anos
pai
achega
8ab31a3784
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      desktop/core/src/desktop/models.py

+ 2 - 0
desktop/core/src/desktop/models.py

@@ -510,8 +510,10 @@ class DocumentManager(models.Manager):
 
             tag = DocumentTag.objects.get_example_tag(user=doc.owner)
             doc.tags.add(tag)
+            doc_last_modified = doc.last_modified
 
             doc.save()
+            Document.objects.filter(id=doc.id).update(last_modified=doc_last_modified)
       except Exception, e:
         LOG.exception('error sharing sample user documents')