Skip to content

Commit

Permalink
Add a field to store estimated hours for bounties
Browse files Browse the repository at this point in the history
  • Loading branch information
kn committed Nov 29, 2018
1 parent 9f59f77 commit 51ae34a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/dashboard/migrations/0124_bounty_estimated_hours.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 2.1.2 on 2018-11-29 01:34

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('dashboard', '0123_auto_20181128_1545'),
]

operations = [
migrations.AddField(
model_name='bounty',
name='estimated_hours',
field=models.PositiveIntegerField(blank=True, null=True),
),
]
1 change: 1 addition & 0 deletions app/dashboard/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ class Bounty(SuperModel):
token_address = models.CharField(max_length=50)
bounty_type = models.CharField(max_length=50, choices=BOUNTY_TYPES, blank=True)
project_length = models.CharField(max_length=50, choices=PROJECT_LENGTHS, blank=True)
estimated_hours = models.PositiveIntegerField(blank=True, null=True)
experience_level = models.CharField(max_length=50, choices=EXPERIENCE_LEVELS, blank=True)
github_url = models.URLField(db_index=True)
github_issue_details = JSONField(default=dict, blank=True, null=True)
Expand Down
4 changes: 3 additions & 1 deletion app/dashboard/tests/test_dashboard_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def test_bounty():
bounty_type='Feature',
experience_level='Intermediate',
raw_data={},
estimated_hours=7,
)
bounty_fulfillment = BountyFulfillment.objects.create(
fulfiller_address='0x0000000000000000000000000000000000000000',
Expand All @@ -76,7 +77,7 @@ def test_bounty():
bounty=bounty,
profile=fulfiller_profile,
)
assert str(bounty) == f'5: foo, 0 ETH @ {naturaltime(bounty.web3_created)}'
assert str(bounty) == f'{bounty.pk}: foo, 0 ETH @ {naturaltime(bounty.web3_created)}'
assert bounty.url == f'{settings.BASE_URL}issue/gitcoinco/web/11/{bounty.standard_bounties_id}'
assert bounty.title_or_desc == 'foo'
assert bounty.issue_description_text == 'hello world'
Expand All @@ -92,6 +93,7 @@ def test_bounty():
assert 'ago 5 Feature Intermediate' in bounty.desc
assert bounty.is_legacy is False
assert bounty.get_github_api_url() == 'https://api.github.com/repos/gitcoinco/web/issues/11'
assert bounty.estimated_hours == 7
assert bounty_fulfillment.profile.handle == 'fred'
assert bounty_fulfillment.bounty.title == 'foo'

Expand Down

0 comments on commit 51ae34a

Please sign in to comment.