grants.views

Define the Grant views.

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/.

get_keywords

get_keywords()

Get all Keywords.

grants

grants(request)

Handle grants explorer.

clr_grants

clr_grants(request, round_num, sub_round_slug='', customer_name='')

CLR grants explorer.

grants_by_grant_type

grants_by_grant_type(request, grant_type)

Handle grants explorer.

get_grant_tags

get_grant_tags(request)

Fetch matching grants tags

grants_type_redirect

grants_type_redirect(request, grant_type)

Redirect old grant url with search params to /explorer keeping query params.

grants_by_grant_clr

grants_by_grant_clr(request, clr_round)

Handle grants explorer.

grant_details_api

grant_details_api(request, grant_id)

Json the Grant details.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

grant_details

grant_details(request, grant_id, grant_slug)

Display the Grant details page.

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

grant_new

grant_new(request)

Handle new grant.

grant_fund

grant_fund(request, grant_id, grant_slug)

Handle grant funding.

bulk_fund

bulk_fund(request)

Called when checking out with an Ethereum cart

manage_ethereum_cart_data

manage_ethereum_cart_data(request)

For the specified user address: 1. action == save will save the provided cart data as a JSON Store 2. action == delete will removed saved cart data from the JSON Store

get_ethereum_cart_data

get_ethereum_cart_data(request)

For the specified user address, returns the saved checkout data if found

get_replaced_tx

get_replaced_tx(request)

scrapes etherscan to get the replaced tx

profile

profile(request)

Show grants profile of logged in user.

quickstart

quickstart(request)

Display quickstart guide.

leaderboard

leaderboard(request)

Display leaderboard.

record_subscription_activity_helper

record_subscription_activity_helper(activity_type, subscription, profile, anonymize=False)

Registers a new activity concerning a grant subscription

Args: activity_type (str): The type of activity, as defined in dashboard.models.Activity. subscription (grants.models.Subscription): The subscription in question. profile (dashboard.models.Profile): The current user's profile.

record_grant_activity_helper

record_grant_activity_helper(activity_type, grant, profile, amount=None, token=None)

Registers a new activity concerning a grant

Args: activity_type (str): The type of activity, as defined in dashboard.models.Activity. grant (grants.models.Grant): The grant in question. profile (dashboard.models.Profile): The current user's profile.

ingest_contributions

ingest_contributions(request)

Ingest missing contributions

get_clr_sybil_input

get_clr_sybil_input(request, round_id)

This returns a paginated JSON response to return contributions which are considered while calculating the QF match for a given CLR

get_trust_bonus

get_trust_bonus(request)

JSON POST/GET endpoint which returns the trust bonus score of given addresses

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.

api_toggle_user_sybil

api_toggle_user_sybil(request)

POST endpoint which allows to mark a list of users as sybil or remove them the sybil tag from them. This is intended to be used by BSCI to ensure they can toggle it every 12 hours based on their findings as opposed to having it done at the end.

upload_sybil_csv

upload_sybil_csv(request)

This endpoint would be used by bsci to upload the csv generated by the bsci team which will be uploaded to S3 for further processing. The history of the file uploaded will be stored in S3 and JSONStore would be updated to get the latest csv to mark users as sybil/not

csrf_exempt

bool(x) -> bool

Returns True when the argument x is true, False otherwise. The builtins True and False are the only two instances of the class bool. The class bool is a subclass of the class int, and cannot be subclassed.