Skip to content

Commit

Permalink
kudos transactions were duplicated
Browse files Browse the repository at this point in the history
  • Loading branch information
owocki committed Oct 14, 2019
1 parent ee0fb60 commit ba1411b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/dashboard/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class PortfolioItemAdmin(admin.ModelAdmin):
class EarningAdmin(admin.ModelAdmin):
ordering = ['-id']
list_display = ['created_on', '__str__']
raw_id_fields = ['from_profile', 'to_profile']
raw_id_fields = ['from_profile', 'to_profile', 'org_profile']
search_fields = ['from_profile__handle', 'to_profile__handle']


Expand Down
2 changes: 1 addition & 1 deletion app/dashboard/templates/profiles/scorecard_hunter.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<div id="tx_details" class="collapse">
<li>
- <b>{{ count_bounties_completed }}</b>
Bounties Completed
Bounties completed
</li>
{% if no_times_been_removed %}
<li>
Expand Down
16 changes: 9 additions & 7 deletions app/kudos/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,15 +451,17 @@ def psave_kt(sender, instance, **kwargs):
from django.contrib.contenttypes.models import ContentType
from dashboard.models import Earning
Earning.objects.update_or_create(
created_on=instance.created_on,
from_profile=instance.sender_profile,
org_profile=instance.org_profile,
to_profile=instance.recipient_profile,
value_usd=instance.value_in_usdt_then,
source_type=ContentType.objects.get(app_label='kudos', model='kudostransfer'),
source_id=instance.pk,
url=instance.kudos_token_cloned_from.url,
network=instance.network,
defaults={
"created_on":instance.created_on,
"from_profile":instance.sender_profile,
"org_profile":instance.org_profile,
"to_profile":instance.recipient_profile,
"value_usd":instance.value_in_usdt_then,
"url":instance.kudos_token_cloned_from.url,
"network":instance.network,
}
)


Expand Down

0 comments on commit ba1411b

Please sign in to comment.