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

Notify bounties cancelled for advanced payout as work_done, changed tips to payouts when they come from bounties #3198

Merged
Merged
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
10 changes: 9 additions & 1 deletion app/dashboard/notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,10 @@ def build_message_for_integration(bounty, event_name):

"""
from dashboard.utils import humanize_event_name
event_name_in_msg = humanize_event_name(event_name)
if event_name == 'killed_bounty':
if (bounty.bulk_payout_tips.count()):
event_name_in_msg = humanize_event_name('work_done')
conv_details = ""
usdt_details = ""
try:
Expand All @@ -218,7 +222,7 @@ def build_message_for_integration(bounty, event_name):
pass # no USD conversion rate

title = bounty.title if bounty.title else bounty.github_url
msg = f"*{humanize_event_name(event_name)}*" \
msg = f"*{event_name_in_msg}*" \
f"\n*Issue*: {title}" \
f"\n*Bounty value*: {round(bounty.get_natural_value(), 4)} {bounty.token_name} {usdt_details}" \
f"\n{bounty.get_absolute_url()}"
Expand Down Expand Up @@ -346,6 +350,10 @@ def maybe_market_tip_to_slack(tip, event_name):
if not tip.is_notification_eligible(var_to_check=settings.SLACK_TOKEN):
return False

if tip.bounty:
if tip in tip.bounty.bulk_payout_tips:
event_name = 'Payout'

msg = f"{event_name} worth {round(tip.amount, 4)} {tip.tokenName}"

if tip.github_url:
Expand Down