From f1e382014f911a06fd4e3ac13990dc9f9479cc2e Mon Sep 17 00:00:00 2001
From: Romain Courteaud <romain@nexedi.com>
Date: Wed, 23 Aug 2006 16:39:41 +0000
Subject: [PATCH] Add _setFile method.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@9365 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Image.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/Image.py b/product/ERP5/Document/Image.py
index 872ec40e98..ccecb3ba0a 100644
--- a/product/ERP5/Document/Image.py
+++ b/product/ERP5/Document/Image.py
@@ -78,6 +78,15 @@ class Image (Base, Photo):
       elif self.store == 'ExtImage': from Products.Photo.ExtPhotoImage import PhotoImage
       self._original = PhotoImage(self.id, self.title, path=self.absolute_url(1))
 
+
+  security.declarePrivate('_setFile')
+  def _setFile(self, file):
+    """
+    This is used to set files
+    """
+    Photo.manage_editPhoto(self, file=file)
+    self.manage_purgeDisplays()
+
   security.declarePrivate('_edit')
   def _edit(self, **kw):
     """
@@ -87,8 +96,7 @@ class Image (Base, Photo):
     if kw.has_key('file'):
       file = kw.get('file')
       precondition = kw.get('precondition')
-      Photo.manage_editPhoto(self, file=file)
-      self.manage_purgeDisplays()
+      self._setFile(file)
       del kw['file']
     Base._edit(self, **kw)
 
-- 
2.30.9