diff --git a/.moban.yaml b/.moban.yaml index 35539522..8b8b80ca 100644 --- a/.moban.yaml +++ b/.moban.yaml @@ -11,7 +11,6 @@ packages: - ci_build - meta_review - model - - unassigned_issues dependencies: - getorg~=0.3.1 diff --git a/.nocover.yaml b/.nocover.yaml index d5a2050e..027ea343 100644 --- a/.nocover.yaml +++ b/.nocover.yaml @@ -10,8 +10,6 @@ nocover_file_globs: - gsoc/*.py - ci_build/*.py - meta_review/handler.py - # Optional coverage. Once off scripts. - - unassigned_issues/unassigned_issues_scraper.py # The following rules can remain here # django db - '*/migrations/*.py' diff --git a/community/urls.py b/community/urls.py index 96121a1b..2d4e06f2 100644 --- a/community/urls.py +++ b/community/urls.py @@ -9,7 +9,8 @@ from community.views import ( HomePageView, JoinCommunityView, - OrganizationTeams, InactiveIssuesList + OrganizationTeams, InactiveIssuesList, + UnassignedIssuesActivityList ) from gci.views import GCIStudentsList from gci.feeds import LatestTasksFeed as gci_tasks_rss @@ -17,9 +18,6 @@ from data.views import ContributorsListView from gamification.views import GamificationResults from meta_review.views import ContributorsMetaReview -from unassigned_issues.unassigned_issues_scraper import ( - unassigned_issues_activity_json, -) def get_index(): @@ -84,10 +82,10 @@ def get_index(): distill_file='inactive-issues/index.html', ), distill_url( - r'static/unassigned-issues.json', unassigned_issues_activity_json, - name='unassigned_issues_activity_json', + r'unassigned-issues/', UnassignedIssuesActivityList.as_view(), + name='unassigned-issues', distill_func=get_index, - distill_file='static/unassigned-issues.json', + distill_file='unassigned-issues/index.html', ), distill_url( r'gamification/$', GamificationResults.as_view(), diff --git a/community/views.py b/community/views.py index fdc88fa2..2739b292 100644 --- a/community/views.py +++ b/community/views.py @@ -23,7 +23,7 @@ NewcomerPromotion, Feedback ) -from data.models import Team, InactiveIssue +from data.models import Team, InactiveIssue, UnassignedIssuesActivity from gamification.models import Participant as GamificationParticipant from meta_review.models import Participant as MetaReviewer @@ -234,3 +234,16 @@ def get_context_data(self, **kwargs): context = get_header_and_footer(context) context['page_name'] = 'Inactive Issues List' return context + + +class UnassignedIssuesActivityList(ListView): + + template_name = 'issues.html' + model = UnassignedIssuesActivity + ordering = 'hoster' + + def get_context_data(self, **kwargs): + context = super().get_context_data(**kwargs) + context = get_header_and_footer(context) + context['page_name'] = 'Unassigned Issues Activity List' + return context diff --git a/data/migrations/0010_unassignedissuesactivity.py b/data/migrations/0010_unassignedissuesactivity.py new file mode 100644 index 00000000..cf251856 --- /dev/null +++ b/data/migrations/0010_unassignedissuesactivity.py @@ -0,0 +1,24 @@ +# Generated by Django 2.1.7 on 2019-08-02 12:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('data', '0009_inactiveissue'), + ] + + operations = [ + migrations.CreateModel( + name='UnassignedIssuesActivity', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('hoster', models.CharField(max_length=30)), + ('title', models.CharField(max_length=500)), + ('repository', models.CharField(max_length=100)), + ('number', models.SmallIntegerField()), + ('url', models.URLField()), + ], + ), + ] diff --git a/data/models.py b/data/models.py index b7f4afdc..71db35c8 100644 --- a/data/models.py +++ b/data/models.py @@ -124,3 +124,11 @@ class InactiveIssue(models.Model): repository = models.CharField(max_length=100) number = models.SmallIntegerField() url = models.URLField() + + +class UnassignedIssuesActivity(models.Model): + hoster = models.CharField(max_length=30) + title = models.CharField(max_length=500) + repository = models.CharField(max_length=100) + number = models.SmallIntegerField() + url = models.URLField() diff --git a/setup.cfg b/setup.cfg index cddc1f02..d59fd046 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,7 +15,6 @@ testpaths = gamification ci_build meta_review - unassigned_issues python_files = test_*.py python_classes = *Test @@ -78,7 +77,6 @@ omit = gsoc/*.py ci_build/*.py meta_review/handler.py - unassigned_issues/unassigned_issues_scraper.py */migrations/*.py */management/commands/*.py meta_review/load_from_db.py diff --git a/templates/base.html b/templates/base.html index ec774ee9..ad98415c 100644 --- a/templates/base.html +++ b/templates/base.html @@ -72,7 +72,7 @@