From: Stephen Finucane Date: Sun, 9 Oct 2016 22:35:48 +0000 (+0100) Subject: models: Remove 'UserProfile.primary_project' X-Git-Tag: v2.0.0-rc1~195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=528424733fc8d1595374a0c3ab9caa9038c0054b;p=thirdparty%2Fpatchwork.git models: Remove 'UserProfile.primary_project' This field was unused and has been for a long time (pre-0.9.0). Signed-off-by: Stephen Finucane Reviewed-by: Andrew Donnellan --- diff --git a/patchwork/forms.py b/patchwork/forms.py index 6a9afe14..702779ed 100644 --- a/patchwork/forms.py +++ b/patchwork/forms.py @@ -130,7 +130,7 @@ class UserProfileForm(forms.ModelForm): class Meta: model = UserProfile - fields = ['primary_project', 'items_per_page'] + fields = ['items_per_page'] class OptionalDelegateField(DelegateField): diff --git a/patchwork/migrations/0014_remove_userprofile_primary_project.py b/patchwork/migrations/0014_remove_userprofile_primary_project.py new file mode 100644 index 00000000..0f875bd4 --- /dev/null +++ b/patchwork/migrations/0014_remove_userprofile_primary_project.py @@ -0,0 +1,18 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('patchwork', '0013_slug_check_context'), + ] + + operations = [ + migrations.RemoveField( + model_name='userprofile', + name='primary_project', + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index 217de512..f8759a5c 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -119,7 +119,6 @@ class UserProfile(models.Model): # projects - primary_project = models.ForeignKey(Project, null=True, blank=True) maintainer_projects = models.ManyToManyField( Project, related_name='maintainer_project', blank=True) diff --git a/patchwork/views/user.py b/patchwork/views/user.py index 691a4f93..f76a05f6 100644 --- a/patchwork/views/user.py +++ b/patchwork/views/user.py @@ -111,7 +111,6 @@ def profile(request): # TODO(stephenfin): Add a related_name for User->Bundle context = { - 'project': request.user.profile.primary_project, 'bundles': Bundle.objects.filter(owner=request.user), 'profileform': form, }