Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: fix activity section in bounty #6042

Merged
merged 3 commits into from
Feb 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions app/assets/v2/js/pages/bounty_details.js
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ const process_activities = function(result, bounty_activities) {
bounty_activities.forEach(function(_activity) {
const type = _activity.activity_type;

if (type === 'unknown_event') {
if (type === 'unknown_event' || type === 'receive_kudos') {
return;
}

Expand Down Expand Up @@ -1558,7 +1558,9 @@ const process_activities = function(result, bounty_activities) {

if (type === 'new_kudos') {
to_username = meta.to_username.slice(1);
kudos = _activity.kudos.image;
const kudos_img = _activity.kudos.image;

kudos = kudos_img.startsWith('v2/images/') ? '/static/'.concat(kudos_img) : kudos_img;
} else if (type == 'new_tip') {
tip = {
amount: meta.amount,
Expand Down
4 changes: 1 addition & 3 deletions app/marketing/mails.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,9 +544,7 @@ def send_user_feedback(quest, feedback, user):
try:
setup_lang(to_email)
subject = f"Your Gitcoin Quest \"{quest.title}\" has feedback from another user!"
body_str = f("Your quest: {quest.title} has feedback from user {user.profile.handle}:\n\n"
"{feedback}\n\n"
"to edit your quest, click <a href=\"{quest.edit_url}\">here</a>")
body_str = f"Your quest: {quest.title} has feedback from user {user.profile.handle}:\n\n{feedback}\n\nto edit your quest, click <a href=\"{quest.edit_url}\">here</a>"
body = f"{body_str}"
if not should_suppress_notification_email(to_email, 'quest'):
send_mail(
Expand Down
4 changes: 3 additions & 1 deletion app/townsquare/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def url(self):

def get_absolute_url(self):
return self.activity.url

def process(self):
from dashboard.models import Profile
mr = self
Expand Down Expand Up @@ -292,9 +292,11 @@ def __str__(self):

def get_eligible_input_data(mr):
from dashboard.models import Earning, Profile
from django.contrib.contenttypes.models import ContentType
network = 'mainnet' if not settings.DEBUG else 'rinkeby'
earnings = Earning.objects.filter(created_on__gt=mr.valid_from, created_on__lt=mr.valid_to)
earnings = earnings.filter(to_profile__isnull=False, from_profile__isnull=False, value_usd__isnull=False, network=network)
earnings = earnings.exclude(to_profile__user__is_staff=True)
earnings = earnings.filter(source_type=ContentType.objects.get(app_label='dashboard', model='tip'))
earnings = earnings.values_list('to_profile__pk', 'from_profile__pk', 'value_usd')
return [[ele[0], ele[1], float(ele[2])] for ele in earnings]