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

[WIP] Fixes: https://github.com/gitcoinco/web/issues/1855 #2371

Closed
wants to merge 4 commits into from

Conversation

saketbairoliya2
Copy link

@saketbairoliya2 saketbairoliya2 commented Oct 7, 2018

Description

This PR will handle creation of Bounty directly when a request is submitted.

Checklist
  • linter status: 100% pass
  • changes don't break existing behavior
  • commit message follows commit guidelines
Affected core subsystem(s)
Testing
Refers/Fixes

Refs: #1855

@@ -22,8 +22,14 @@
from django.core.validators import MinValueValidator
from django.db import models

from datetime import date, datetime, timedelta

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F401 'datetime.date' imported but unused


def to_bounty(self, network=None):
"""Creates a bounty with project status as requested. """
print ('self value is {} - {} - Type {}'.format(self.github_url, self.amount, type(self.amount)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E211 whitespace before '('

def to_bounty(self, network=None):
"""Creates a bounty with project status as requested. """
print ('self value is {} - {} - Type {}'.format(self.github_url, self.amount, type(self.amount)))
new_bounty = Bounty.objects.create(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

F841 local variable 'new_bounty' is assigned to but never used

value_true=float(self.amount),
network=network,
web3_created=datetime.now(tz=pytz.UTC),
expires_date=datetime.now(tz=pytz.UTC) + timedelta(days=90), # Request expire in 3 months.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment
W291 trailing whitespace

network=network,
web3_created=datetime.now(tz=pytz.UTC),
expires_date=datetime.now(tz=pytz.UTC) + timedelta(days=90), # Request expire in 3 months.
is_open=False, # By default mark this as False as this will require fund.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment
W291 trailing whitespace

expires_date=datetime.now(tz=pytz.UTC) + timedelta(days=90), # Request expire in 3 months.
is_open=False, # By default mark this as False as this will require fund.
raw_data={},
current_bounty=True # By default it would be marked as the current bounty.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E261 at least two spaces before inline comment
W291 trailing whitespace

current_bounty=True # By default it would be marked as the current bounty.
)

print ('Bounty is created. ')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E211 whitespace before '('

@@ -544,6 +545,8 @@ def status(self):
if not self.is_open:
if self.accepted:
return 'done'
elif self.idx_status=='requested':

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E225 missing whitespace around operator

@codecov
Copy link

codecov bot commented Oct 7, 2018

Codecov Report

Merging #2371 into master will increase coverage by 0.01%.
The diff coverage is 54.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2371      +/-   ##
==========================================
+ Coverage   29.47%   29.49%   +0.01%     
==========================================
  Files         146      146              
  Lines       11777    11787      +10     
  Branches     1599     1600       +1     
==========================================
+ Hits         3471     3476       +5     
- Misses       8188     8192       +4     
- Partials      118      119       +1
Impacted Files Coverage Δ
app/bounty_requests/views.py 36.36% <0%> (-2.35%) ⬇️
app/dashboard/models.py 52.71% <33.33%> (-0.08%) ⬇️
app/bounty_requests/models.py 92.85% <83.33%> (-2.6%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 99a12e2...c520cbc. Read the comment docs.

@@ -64,3 +69,18 @@ class BountyRequest(SuperModel):
def __str__(self):
"""Return the string representation of BountyRequest."""
return f"{self.requested_by.username} / {self.created_on}"

def to_bounty(self, network=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we associate the bountyrequest with the bounty?

@mbeacom
Copy link
Contributor

mbeacom commented Nov 29, 2018

@saketbairoliya2 Is this still a WIP?

@mbeacom mbeacom changed the title Fixes: https://github.com/gitcoinco/web/issues/1855 (WIP) [WIP] Fixes: https://github.com/gitcoinco/web/issues/1855 Nov 29, 2018
@mbeacom mbeacom added frontend This needs frontend expertise. backend This needs backend expertise. wip Gitcoin Bounties Gitcoin Bounties labels Nov 29, 2018
@mbeacom mbeacom requested a review from a team November 29, 2018 03:21
@saketbairoliya2
Copy link
Author

saketbairoliya2 commented Nov 29, 2018 via email

@octavioamu
Copy link
Contributor

octavioamu commented Nov 29, 2018

In general is looking good but need a rebase with the current explorer changes, lot of things had changed in the explorer

Copy link
Contributor

@octavioamu octavioamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need rebase with master changes in explorer

@kuhnchris
Copy link
Contributor

@saketbairoliya2 @octavioamu i rebased it over at #3734

@thelostone-mc
Copy link
Member

Closing this out based on above comment ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend This needs backend expertise. frontend This needs frontend expertise. Gitcoin Bounties Gitcoin Bounties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants