src/iconolab/models.py
changeset 35 31d4f0e86723
parent 34 1ede957a6868
child 37 aed809b3a075
--- a/src/iconolab/models.py	Fri Jun 24 12:39:13 2016 +0200
+++ b/src/iconolab/models.py	Fri Jun 24 14:26:56 2016 +0200
@@ -136,7 +136,7 @@
 	
 	# Call to create a new revision, possibly from a merge
 	@transaction.atomic
-	def make_new_revision(self, author, title, description, fragment, tags):
+	def make_new_revision(self, author, title, description, fragment, tags_json):
 		if author == self.author:
 			# We're creating an automatically accepted revision
 			new_revision_state = AnnotationRevision.ACCEPTED
@@ -153,6 +153,7 @@
 			state=new_revision_state
 		)
 		new_revision.save()
+		new_revision.set_tags(tags_json)
 		if new_revision.state == AnnotationRevision.ACCEPTED:
 			self.current_revision = new_revision
 			self.save()
@@ -222,8 +223,8 @@
 				tag_obj = Tag.objects.create(
 					label = tag_string,
 					description = "",
-					link = settings.BASE_URL+tag_string,
-					collection = self.parent_annotation.image.item.collection
+					link = settings.BASE_URL+'/'+tag_string,
+					collection = self.annotation.image.item.collection
 				)
 			tag_info = TaggingInfo.objects.create(
 				tag=tag_obj,