Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Slight refactor of the review models to capture review team settings.…
… Allows configuring review teams to get automatic suggestions for reviews or not. Provides a better admin for creating/managing review teams. Fixes #2048 and #2072. Commit ready for merge. - Legacy-Id: 12520
- Loading branch information
Showing
10 changed files
with
141 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
import ietf.review.models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('name', '0016_auto_20161013_1010'), | ||
('group', '0009_auto_20150930_0758'), | ||
('review', '0006_auto_20161209_0436'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ReviewTeamSettings', | ||
fields=[ | ||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), | ||
('autosuggest', models.BooleanField(default=True, verbose_name=b'Automatically suggest possible review requests')), | ||
('group', models.OneToOneField(to='group.Group')), | ||
('review_results', models.ManyToManyField(default=ietf.review.models.get_default_review_results, to='name.ReviewResultName')), | ||
('review_types', models.ManyToManyField(default=ietf.review.models.get_default_review_types, to='name.ReviewTypeName')), | ||
], | ||
options={ | ||
'verbose_name': 'Review team settings', | ||
'verbose_name_plural': 'Review team settings', | ||
}, | ||
), | ||
] |
29 changes: 29 additions & 0 deletions
29
ietf/review/migrations/0008_populate_reviewteamsettings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# -*- coding: utf-8 -*- | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations | ||
|
||
def forward(apps, schema_editor): | ||
ReviewTeamSettings = apps.get_model('review','ReviewTeamSettings') | ||
ResultUsedInReviewTeam = apps.get_model('review','ResultUsedInReviewTeam') | ||
TypeUsedInReviewTeam = apps.get_model('review','TypeUsedInReviewTeam') | ||
|
||
for group_id in ResultUsedInReviewTeam.objects.values_list('team',flat=True).distinct(): | ||
rts = ReviewTeamSettings.objects.create(group_id=group_id) | ||
rts.review_types = TypeUsedInReviewTeam.objects.filter(team_id=group_id).values_list('type',flat=True).distinct() | ||
rts.review_results = ResultUsedInReviewTeam.objects.filter(team_id=group_id).values_list('result',flat=True).distinct() | ||
|
||
|
||
def reverse(apps, schema_editor): | ||
ReviewTeamSettings = apps.get_model('review','ReviewTeamSettings') | ||
ReviewTeamSettings.objects.all().delete() | ||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('review', '0007_reviewteamsettings'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(forward, reverse) | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.