fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
4651ff4
)
fix weird bug (race condition?)
author
Jan Szejko
<janek37@gmail.com>
Thu, 13 Sep 2018 10:55:34 +0000
(12:55 +0200)
committer
Jan Szejko
<janek37@gmail.com>
Thu, 13 Sep 2018 10:55:34 +0000
(12:55 +0200)
src/newtagging/models.py
patch
|
blob
|
history
diff --git
a/src/newtagging/models.py
b/src/newtagging/models.py
index
9d12111
..
e42295d
100644
(file)
--- a/
src/newtagging/models.py
+++ b/
src/newtagging/models.py
@@
-64,7
+64,7
@@
class TagManager(models.Manager):
# Add new tags
tags_to_add = [tag for tag in updated_tags if tag not in current_tags]
for tag in tags_to_add:
- self.intermediary_table_model.objects.create(tag=tag, content_object=obj)
+ self.intermediary_table_model.objects.
get_or_
create(tag=tag, content_object=obj)
tags_updated.send(sender=type(obj), instance=obj, affected_tags=tags_to_add + tags_for_removal)