Пример #1
0
 def contribution_added(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     amount = '{} {}'.format(bounty.tokenSymbol,
                             bounty.calculated_fulfillmentAmount)
     string_data = CONTRIBUTION_ADDED_STR.format(bounty_title=bounty.title,
                                                 amount=amount)
     create_notification(bounty, CONTRIBUTION_ADDED, bounty.user,
                         event_date, string_data, 'Contribution Added')
Пример #2
0
 def bounty_issued_and_activated(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = BOUNTY_ACTIVATED_STR.format(bounty_title=bounty.title)
     create_notification(bounty,
                         BOUNTY_ISSUED_ACTIVATED,
                         bounty.user,
                         event_date,
                         string_data,
                         'Bounty Issued and Activated',
                         should_send_email=True)
Пример #3
0
 def bounty_expired(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = BOUNTY_EXPIRED_STR.format(bounty_title=bounty.title)
     create_notification(bounty,
                         BOUNTY_EXPIRED,
                         bounty.user,
                         event_date,
                         string_data,
                         'Bounty Expired',
                         should_send_email=True)
Пример #4
0
 def issuer_transferred(self, bounty_id, transaction_from, inputs,
                        event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     original_user = User.objects.get(public_address=transaction_from)
     string_data_transferrer = ISSUER_TRANSFERRED_STR.format(
         bounty_title=bounty.title)
     string_data_recipient = ISSUER_TRANSFERRED_RECIPIENT_STR.format(
         bounty_title=bounty.title)
     create_notification(bounty, ISSUER_TRANSFERRED, original_user,
                         event_date, string_data_transferrer,
                         'Bounty Transferred')
     create_notification(bounty, TRANSFER_RECIPIENT, bounty.user,
                         event_date, string_data_recipient,
                         'A Bounty was Transferred to You')
Пример #5
0
 def fulfillment_accepted(self, bounty_id, fulfillment_id, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     fulfillment = Fulfillment.objects.get(bounty_id=bounty,
                                           fulfillment_id=fulfillment_id)
     string_data_issuer = FULFILLMENT_ACCEPTED_ISSUER_STR.format(
         bounty_title=bounty.title)
     string_data_fulfiller = FULFILLMENT_ACCEPTED_FULFILLER_STR.format(
         bounty_title=bounty.title)
     create_notification(bounty, FULFILLMENT_ACCEPTED, bounty.user,
                         fulfillment.accepted_date, string_data_issuer,
                         'Submission Accepted')
     create_notification(bounty,
                         FULFILLMENT_ACCEPTED,
                         fulfillment.user,
                         fulfillment.accepted_date,
                         string_data_fulfiller,
                         'Your Submission was Accepted',
                         is_activity=False)
Пример #6
0
 def bounty_fulfilled(self, bounty_id, fulfillment_id, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     fulfillment = Fulfillment.objects.get(fulfillment_id=fulfillment_id,
                                           bounty=bounty)
     string_data_fulfiller = FULFILLMENT_SUBMITTED_FULFILLER_STR.format(
         bounty_title=bounty.title)
     string_data_issuer = FULFILLMENT_SUBMITTED_ISSUER_STR.format(
         bounty_title=bounty.title)
     # to fulfiller
     create_notification(bounty,
                         FULFILLMENT_SUBMITTED,
                         fulfillment.user,
                         fulfillment.fulfillment_created,
                         string_data_fulfiller,
                         'New Submission',
                         is_activity=False)
     # to bounty issuer
     create_notification(bounty, FULFILLMENT_SUBMITTED, bounty.user,
                         fulfillment.fulfillment_created,
                         string_data_issuer,
                         'You Received a New Submission')
Пример #7
0
 def fulfillment_updated(self, bounty_id, fulfillment_id, event_date,
                         **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     fulfillment = Fulfillment.objects.get(bounty_id=bounty,
                                           fulfillment_id=fulfillment_id)
     string_data_issuer = FULFILLMENT_UPDATED_ISSUER_STR.format(
         bounty_title=bounty.title)
     string_data_fulfiller = FULFILLMENT_UPDATED_FULFILLER_STR.format(
         bounty_title=bounty.title)
     create_notification(bounty,
                         FULFILLMENT_UPDATED,
                         bounty.user,
                         event_date,
                         string_data_issuer,
                         'ASsubmission was Updated',
                         is_activity=False)
     create_notification(bounty,
                         FULFILLMENT_UPDATED,
                         fulfillment.user,
                         event_date,
                         string_data_fulfiller,
                         'Submission Updated',
                         is_activity=False)
Пример #8
0
 def payout_increased(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = PAYOUT_INCREASED_STR.format(bounty_title=bounty.title)
     create_notification(bounty, PAYOUT_INCREASED, bounty.user, event_date,
                         string_data, 'Payout Increased')
Пример #9
0
 def bounty_changed(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = BOUNTY_CHANGED_STR.format(bounty_title=bounty.title)
     create_notification(bounty, BOUNTY_CHANGED, bounty.user, event_date,
                         string_data, 'Bounty Updated')
Пример #10
0
 def deadline_extended(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = DEADLINE_EXTENDED_STR.format(bounty_title=bounty.title)
     create_notification(bounty, DEADLINE_EXTENDED, bounty.user, event_date,
                         string_data, 'Deadline Extended')
Пример #11
0
 def bounty_issued(self, bounty_id, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = BOUNTY_ISSUED_STR.format(bounty_title=bounty.title)
     create_notification(bounty, BOUNTY_ISSUED, bounty.user,
                         bounty.bounty_created, string_data,
                         'New bounty issued')
Пример #12
0
 def bounty_activated(self, bounty_id, event_date, **kwargs):
     bounty = Bounty.objects.get(id=bounty_id)
     string_data = BOUNTY_ACTIVATED_STR.format(bounty_title=bounty.title)
     create_notification(bounty, BOUNTY_ACTIVATED, bounty.user, event_date,
                         string_data, 'Bounty Activated')