aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-30 16:03:44 +0200
committerStanislav Ochotnicky <sochotnicky@gmail.com>2009-07-30 18:57:50 +0200
commit75696818c935b796084397f235b9f46224b81f50 (patch)
treeda71ca3c697d4e6728d0e6945e49e4d011d9b88a /src
parentAdded function to db layer to get package version (diff)
downloadcollagen-75696818c935b796084397f235b9f46224b81f50.tar.gz
collagen-75696818c935b796084397f235b9f46224b81f50.tar.bz2
collagen-75696818c935b796084397f235b9f46224b81f50.zip
[db] Fixed issue with adding useflags to package properties
clearing in the beginning and saving afterwards to make sure it gets saved
Diffstat (limited to 'src')
-rw-r--r--src/matchbox/db/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/matchbox/db/__init__.py b/src/matchbox/db/__init__.py
index 347236a..23821be 100644
--- a/src/matchbox/db/__init__.py
+++ b/src/matchbox/db/__init__.py
@@ -266,10 +266,11 @@ class DjangoDB(object):
@dbquery
def add_useflags_to_packageproperies(self, packageproperties_id, useflag_ids):
pp = PackageProperties.objects.get(pk=packageproperties_id)
-
+ pp.useflags.clear()
for id in useflag_ids:
useflag = Useflag.objects.get(pk=id)
pp.useflags.add(useflag)
+ pp.save()
@dbquery
def add_contents_to_packageproperties(self, packageproperties_id, contents):