Comments (5)
I can't reproduce this at all.
from drum.
You can only do it on others' posts. Not your own posts.
from drum.
Yes I tried that - can you try and look into it further and determine what the cause is? That will better reveal whether there actually is a bug or not.
from drum.
Forgive me for I am still a novice in using Django, Mezzanine and AJAX. But I am trying hard to figure out the problem. My guess is this line of code only caters to stop the OP from bumping up their own karma score ?
if rating.user != content_object.user:
@receiver(post_save, sender=Rating)
def karma(sender, **kwargs):
"""
Each time a rating is saved, check its value and modify the
profile karma for the related object's user accordingly.
Since ratings are either +1/-1, if a rating is being edited,
we can assume that the existing rating is in the other direction,
so we multiply the karma modifier by 2.
"""
rating = kwargs["instance"]
value = int(rating.value)
if not kwargs["created"]:
value *= 2
content_object = rating.content_object
if rating.user != content_object.user:
queryset = Profile.objects.filter(user=content_object.user)
queryset.update(karma=models.F("karma") + value)
from drum.
I'm sorry I misread your original message as allowing the voting score to change - you're right the karma changes multiple times when it shouldn't.
Thanks
from drum.
Related Issues (20)
- See users who upvoted a certain link HOT 1
- Error Python 3 when install library "topia.termextract" for auto_tag HOT 2
- Auto tags with more than 1 word
- Tests HOT 5
- do not work with django 1.9.* HOT 1
- add tox.ini and travis.yml configs
- Auto tags issue HOT 2
- ProfileNotConfigured Error HOT 4
- Following setup instructions, demo site not working. HOT 3
- manage.py poll_rss fails. HOT 3
- Error on createdb: mezzanine.accounts.ProfileNotConfigured HOT 2
- Sub-reddits? HOT 1
- ImportError: cannot import name 'patterns' with Django 1.10 HOT 1
- Add build/test status HOT 3
- Problems starting a mezzanine project with Drum installed HOT 3
- [Demo] cannot create new account on demo HOT 1
- How are comments displayed? Controlling display of comments.
- Refresh in LinkDetail HOT 2
- CSS?
- Links for live demo and food news are down.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drum.