diff --git a/.moban.yaml b/.moban.yaml index 51c7b8a2..995a14c1 100644 --- a/.moban.yaml +++ b/.moban.yaml @@ -11,7 +11,6 @@ packages: - ci_build - meta_review - twitter - - unassigned_issues dependencies: - getorg~=0.3.1 diff --git a/.nocover.yaml b/.nocover.yaml index 7af2e0fd..60f2ac50 100644 --- a/.nocover.yaml +++ b/.nocover.yaml @@ -12,8 +12,6 @@ nocover_file_globs: - meta_review/handler.py - openhub/*.py - twitter/*.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 ed1b3e73..f6a4b025 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 @@ -18,9 +19,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(): @@ -91,10 +89,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 ddd0eb3c..c2cc1930 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 @@ -231,3 +231,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 4a565768..71c8543d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -16,7 +16,6 @@ testpaths = ci_build meta_review twitter - unassigned_issues python_files = test_*.py python_classes = *Test @@ -70,7 +69,6 @@ source = ci_build meta_review twitter - unassigned_issues omit = tests/* @@ -82,7 +80,6 @@ omit = meta_review/handler.py openhub/*.py twitter/*.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 9fc054c8..ec77054b 100644 --- a/templates/base.html +++ b/templates/base.html @@ -79,7 +79,7 @@