dashboard.notifications

Handle dashboard related notifications.

Copyright (C) 2021 Gitcoin Core

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

notify_of_lowball_bounty

notify_of_lowball_bounty(bounty)

Send an email to founders@gitcoin.co with the lowball bounty info

Args: bounty (dashboard.models.Bounty): The lowball bounty object

github_org_to_twitter_tags

github_org_to_twitter_tags(github_org)

Build a string of github organization twitter tags.

Args: github_org (str): The Github organization.

Returns: str: The concatenated string of twitter tags.

build_message_for_integration

build_message_for_integration(bounty, event_name)

Build message to be posted to integrated service (e.g. slack).

Args: bounty (dashboard.models.Bounty): The Bounty to be marketed. event_name (str): The name of the event.

Returns: str: Message to post to slack.

maybe_market_tip_to_email

maybe_market_tip_to_email(tip, emails)

Send an email for the specified Tip.

Args: tip (dashboard.models.Tip): The Tip to be marketed. emails (list of str): The list of emails to notify.

Returns: bool: Whether or not the email notification was sent successfully.

maybe_market_tip_to_slack

maybe_market_tip_to_slack(tip, event_name)

Send a Slack message for the specified Tip.

Args: tip (dashboard.models.Tip): The Tip to be marketed. event_name (str): The name of the event.

Returns: bool: Whether or not the Slack notification was sent successfully.

maybe_market_kudos_to_email

maybe_market_kudos_to_email(kudos_transfer)

Send an email for the specified Kudos. The general flow of this function:

    1. Decide if we are sending it
    1. Generate subject
    1. Render email
    1. Send email
    1. Do translation

Args: kudos_transfer (kudos.models.KudosTransfer): The Kudos Email object to be marketed.

Returns: bool: Whether or not the email notification was sent successfully.

build_github_notification

build_github_notification(bounty, event_name, profile_pairs=None)

Build a Github comment for the specified Bounty.

Args: bounty (dashboard.models.Bounty): The Bounty to be marketed. event_name (str): The name of the event. profile_pairs (list of tuples): The list of username and profile page URL tuple pairs.

Returns: bool: Whether or not the Github comment was posted successfully.

maybe_market_to_github

maybe_market_to_github(bounty, event_name, profile_pairs=None)

Post a Github comment for the specified Bounty.

Args: bounty (dashboard.models.Bounty): The Bounty to be marketed. event_name (str): The name of the event. profile_pairs (list of tuples): The list of username and profile page URL tuple pairs.

Returns: bool: Whether or not the Github comment was posted successfully.

amount_usdt_open_work

amount_usdt_open_work()

Get the amount in USDT of all current open and submitted work.

Returns: float: The sum of all USDT values rounded to the nearest 2 decimals.

open_bounties

open_bounties()

Get all current open and submitted work.

Returns: QuerySet: The mainnet Bounty objects which are of open and submitted work statuses.

maybe_market_tip_to_github

maybe_market_tip_to_github(tip)

Post a Github comment for the specified Tip.

Args: tip (dashboard.models.Tip): The Tip to be marketed.

Returns: bool: Whether or not the Github comment was posted successfully.

maybe_market_kudos_to_github

maybe_market_kudos_to_github(kt)

Post a Github comment for the specified Kudos.

Args: kt (kudos.models.KudosTransfer): The KudosTransfer to be marketed.

Returns: bool: Whether or not the Github comment was posted successfully.

append_snooze_copy

append_snooze_copy(bounty)

Build the snooze copy for the associated Bounty.

Args: bounty (dashboard.Bounty): The Bounty to create snooze copy for.

Returns: str: The snooze copy for the provided bounty.