From 3226e5830d3cc4057729e1c87548ac79f33c2a87 Mon Sep 17 00:00:00 2001 From: octavioamu Date: Wed, 31 Oct 2018 21:14:24 -0300 Subject: [PATCH 1/2] fix ajax kudos fetch from profile --- app/dashboard/views.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/app/dashboard/views.py b/app/dashboard/views.py index ab504459079..fd1092e0c17 100644 --- a/app/dashboard/views.py +++ b/app/dashboard/views.py @@ -1167,16 +1167,8 @@ def profile(request, handle): if request.method == 'POST' and request.is_ajax(): # Send kudos data when new preferred address address = request.POST.get('address') - context['kudos'] = Token.objects.select_related('kudos_transfer', 'contract').filter( - Q(owner_address__iexact=address) | - Q(kudos_transfer__recipient_profile=profile), - contract__network=settings.KUDOS_NETWORK, - ).distinct('id').order_by('id', order_by) - context['sent_kudos'] = Token.objects.select_related('contract', 'kudos_transfer').filter( - Q(kudos_transfer__from_address__iexact=address) | - Q(kudos_transfer__sender_profile=profile), - contract__network=settings.KUDOS_NETWORK, - ).distinct('id').order_by('id', order_by) + context['kudos'] = profile.get_my_kudos.order_by('id', order_by) + context['sent_kudos'] = profile.get_sent_kudos.order_by('id', order_by) profile.preferred_payout_address = address kudos_html = loader.render_to_string('shared/profile_kudos.html', context) From 7baa380a1a5ba8911deb12525511c888f595a63e Mon Sep 17 00:00:00 2001 From: octavioamu Date: Wed, 31 Oct 2018 23:50:43 -0300 Subject: [PATCH 2/2] fix save address on receive --- app/kudos/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/kudos/views.py b/app/kudos/views.py index 949eb9f8c81..4dc5c592c63 100644 --- a/app/kudos/views.py +++ b/app/kudos/views.py @@ -487,7 +487,7 @@ def receive(request, key, txid, network): # db mutations try: if params['save_addr']: - profile = get_profile(kudos_transfer.username) + profile = get_profile(kudos_transfer.username.replace('@', '')) if profile: # TODO: Does this mean that the address the user enters in the receive form # Will overwrite an already existing preferred_payout_address? Should we