]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
models: Remove 'UserProfile.primary_project'
authorStephen Finucane <stephen@that.guru>
Sun, 9 Oct 2016 22:35:48 +0000 (23:35 +0100)
committerStephen Finucane <stephen@that.guru>
Mon, 10 Oct 2016 21:22:35 +0000 (22:22 +0100)
This field was unused and has been for a long time (pre-0.9.0).

Signed-off-by: Stephen Finucane <stephen@that.guru>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
patchwork/forms.py
patchwork/migrations/0014_remove_userprofile_primary_project.py [new file with mode: 0644]
patchwork/models.py
patchwork/views/user.py

index 6a9afe148a9b444987af68a72394e119b6655a5f..702779ed9f7cdb63bcdc9a0332e6691d49cb6484 100644 (file)
@@ -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 (file)
index 0000000..0f875bd
--- /dev/null
@@ -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',
+        ),
+    ]
index 217de5121667c54577341c960cb0e97d998b4bb5..f8759a5c8f8b93b46de4aba624fa0467e8c947b7 100644 (file)
@@ -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)
 
index 691a4f93fc91b5ab6b36b7892434a651ac2e452a..f76a05f69e6851158b86e42f551721354969a7d3 100644 (file)
@@ -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,
     }