Skip to content

Commit

Permalink
Merge pull request #1778 from jelanmathewjames/dev
Browse files Browse the repository at this point in the history
Remove code for adding karma log entry on negative karma
  • Loading branch information
adnankattekaden authored Dec 7, 2023
2 parents aff98c7 + a3efe27 commit 4781cf0
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions api/dashboard/profile/profile_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,17 +374,18 @@ def update(self, instance, validated_data):
def create_karma_activity_log(task_title, karma_value):
task = TaskList.objects.filter(title=task_title).first()
if task:
KarmaActivityLog.objects.create(
task_id=task.id,
karma=karma_value,
user_id=user_id,
updated_by_id=user_id,
created_by_id=user_id,
peer_approved=True,
peer_approved_by_id=user_id,
appraiser_approved_by_id=user_id,
appraiser_approved=True,
)
if karma_value > 0:
KarmaActivityLog.objects.create(
task_id=task.id,
karma=karma_value,
user_id=user_id,
updated_by_id=user_id,
created_by_id=user_id,
peer_approved=True,
peer_approved_by_id=user_id,
appraiser_approved_by_id=user_id,
appraiser_approved=True,
)
Wallet.objects.filter(user_id=user_id).update(
karma=F("karma") + karma_value,
updated_by_id=user_id
Expand Down

0 comments on commit 4781cf0

Please sign in to comment.