upgrade to new CW api - add localperms cube dependency ; closes #1993000

authorFlorent Cayr? <florent.cayre@gmail.com>
changeset1d2cfd24e5a5
branchdefault
phasepublic
hiddenno
parent revision#312982c3d329 backport stable
child revision#971c938aa2ab missing comma
files modified by this revision
__pkginfo__.py
debian/control
views/forms.py
# HG changeset patch
# User Florent Cayré <florent.cayre@gmail.com>
# Date 1318490514 -7200
# Thu Oct 13 09:21:54 2011 +0200
# Node ID 1d2cfd24e5a5e5311385a01115e3c31e1487e5e2
# Parent 312982c3d3293be6340cb4b3951fcd6b450929ee
upgrade to new CW api - add localperms cube dependency ; closes #1993000

diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -17,15 +17,15 @@
1             'Framework :: CubicWeb',
2             'Programming Language :: Python',
3             'Programming Language :: JavaScript',
4             ]
5 
6 -__depends__ = {'cubicweb': '>= 3.12.6',
7 +__depends__ = {'cubicweb': '>= 3.14.0',
8 +               'cubicweb-localperms': '>= 0.1.0'
9                 'logilab-mtconverter': '>= 0.7.0',
10                 }
11 
12 -
13  # packaging ###
14 
15  from os import listdir as _listdir
16  from os.path import join, isdir
17  from glob import glob
diff --git a/debian/control b/debian/control
@@ -7,11 +7,11 @@
18  Standards-Version: 3.8.0
19  Homepage: http://www.cubicweb.org/project/cubicweb-vcsfile
20 
21  Package: cubicweb-vcsfile
22  Architecture: all
23 -Depends: cubicweb-common (>= 3.12.6), python-logilab-mtconverter (>= 0.5.0), python-subversion | mercurial
24 +Depends: cubicweb-common (>= 3.14.0), python-logilab-mtconverter (>= 0.5.0), cubicweb-localperms, python-subversion | mercurial
25  Conflicts: cubicweb-jpl-extranet (< 0.13.1)
26  Description: component to use version control systems from the CubicWeb framework
27   CubicWeb VCSFile component to integrate with version control systems and
28   make their data available from within a CubicWeb application (currently
29   works for mercurial and subversion).
diff --git a/views/forms.py b/views/forms.py
@@ -64,18 +64,18 @@
30              rschema, existant, card)
31 
32  class RevisionIEditControlAdapter(editcontroller.IEditControlAdapter):
33      __select__ = is_instance('Revision')
34 
35 -    def pre_web_edit(self):
36 +    def pre_web_edit(self, form):
37          """callback called by the web editcontroller when an entity will be
38          created/modified, to let a chance to do some entity specific stuff.
39          """
40          if not self.entity.has_eid():
41              try:
42 -                repoeid = self.entity.linked_to('from_repository', 'subject', remove=False)[0]
43 -            except IndexError:
44 +                repoeid = form.linked_to[('from_repository', 'subject')][0]
45 +            except KeyError:
46                  raise RequestError('missing repository information')
47              self._cw.set_shared_data('vcsrepoeid', repoeid, querydata=True)
48 
49 
50  class VCInlinedCreationFormView(autoform.InlineEntityCreationFormView):