Mercurial > kallithea
annotate MANIFEST.in @ 8925:ee1da602b590 stable
repo_groups: fix deletion of subgroups
Deletion of a repository group that has a parent group (i.e. is not at the
root of the repository group tree) failed as follows:
Traceback (most recent call last):
[...]
File ".../lib/python3.9/site-packages/tg/configurator/components/dispatch.py", line 114, in _call_controller
return controller(*remainder, **params)
File "<decorator-gen-5>", line 2, in delete
File "/home/tdescham/repo/contrib/kallithea/kallithea-release/kallithea/lib/auth.py", line 572, in __wrapper
return func(*fargs, **fkwargs)
File "/home/tdescham/repo/contrib/kallithea/kallithea-release/kallithea/controllers/admin/repo_groups.py", line 271, in delete
if gr.parent_group:
File ".../lib/python3.9/site-packages/sqlalchemy/orm/attributes.py", line 294, in __get__
return self.impl.get(instance_state(instance), dict_)
File ".../lib/python3.9/site-packages/sqlalchemy/orm/attributes.py", line 730, in get
value = self.callable_(state, passive)
File ".../lib/python3.9/site-packages/sqlalchemy/orm/strategies.py", line 717, in _load_for_state
raise orm_exc.DetachedInstanceError(
sqlalchemy.orm.exc.DetachedInstanceError: Parent instance <RepoGroup at 0x7f1f2664f4c0> is not bound to a Session; lazy load operation of attribute 'parent_group' cannot proceed (Background on this error at: http://sqlalche.me/e/13/bhk3)
In the reference 'gr.parent_group', 'gr' is an SQLAlchemy object referring
to the group being deleted, and 'gr.parent_group' is a lazy reference to its
parent group. The 'lazy' means that the parent group object is not loaded
automatically when 'gr' is assigned, but instead will be loaded on-the-fly
when the parent group is actually accessed. See [1] and [2] for more
information.
The problem was that the lazy 'parent_group' attribute was accessed _after_
deleting the database object it was part of.
Fix this by obtaining a handle to the parent group _before_ deleting the
subgroup.
Reported-by: André Klitzing (via mailing list)
[1] https://docs.sqlalchemy.org/en/13/errors.html#error-bhk3
[2] https://docs.sqlalchemy.org/en/13/orm/loading_relationships.html
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Wed, 01 Sep 2021 22:08:45 +0200 |
parents | a8b59e65b98f |
children |
rev | line source |
---|---|
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
1 include .coveragerc |
8420
97c5e6ac5c75
MANIFEST.in: add missing .eslintrc.js added in commit 4d36432bf705
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7968
diff
changeset
|
2 include .eslintrc.js |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
3 include Apache-License-2.0.txt |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
4 include CONTRIBUTORS |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
5 include COPYING |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
6 include Jenkinsfile |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
7 include LICENSE-MERGELY.html |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
8 include LICENSE.md |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
9 include MIT-Permissive-License.txt |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
10 include README.rst |
7968
ddfecf9fe7f2
MANIFEST.in: add missing conftest.py added in commit afa5e0bdb76f
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
7459
diff
changeset
|
11 include conftest.py |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
12 include dev_requirements.txt |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
13 include development.ini |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
14 include pytest.ini |
8896
a8b59e65b98f
MANIFEST.in: add missing pytype_requirements.txt added in commit 278cc5936ed5
Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
parents:
8651
diff
changeset
|
15 include pytype_requirements.txt |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
16 include requirements.txt |
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
17 include tox.ini |
1078
2d7a94f3eaae
added docs to manifest, updated setup script
Marcin Kuzminski <marcin@python-works.com>
parents:
1077
diff
changeset
|
18 recursive-include docs * |
1143
0e6035a85980
added changes made in production branch back into beta
Marcin Kuzminski <marcin@python-works.com>
parents:
1078
diff
changeset
|
19 recursive-include init.d * |
6017
7894a440e134
db: add Alembic "migration environment"
Søren Løvborg <sorenl@unity3d.com>
parents:
6015
diff
changeset
|
20 recursive-include kallithea/alembic * |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
21 include kallithea/bin/ldap_sync.conf |
7459
19a9f02443c8
front-end: Introduce 'front-end' directory with source files for building the front-end
Mads Kiilerich <mads@kiilerich.com>
parents:
7458
diff
changeset
|
22 recursive-include kallithea/front-end * |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
23 recursive-include kallithea/i18n * |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
24 recursive-include kallithea/public * |
4186
7e5f8c12a3fc
First step in two-part process to rename directories to kallithea.
Bradley M. Kuhn <bkuhn@sfconservancy.org>
parents:
1512
diff
changeset
|
25 recursive-include kallithea/templates * |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
26 recursive-include kallithea/tests/fixtures * |
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
27 recursive-include kallithea/tests/scripts * |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
28 include kallithea/tests/models/test_dump_html_mails.ref.html |
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
29 include kallithea/tests/performance/test_vcs.py |
4987
ff08d3cf9aef
manifest: include (almost) all repo files in the release tar
Mads Kiilerich <madski@unity3d.com>
parents:
4569
diff
changeset
|
30 include kallithea/tests/vcs/aconfig |
6790
8cea7986ed79
manifest: update file name list - for example, fix the path to the template.ini.mako config template
Mads Kiilerich <mads@kiilerich.com>
parents:
6555
diff
changeset
|
31 recursive-include scripts * |