]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
models: Allow to unselect maintainer projects in user profile
authorThomas Monjalon <thomas.monjalon@6wind.com>
Sat, 30 Jan 2016 15:34:34 +0000 (16:34 +0100)
committerStephen Finucane <stephen.finucane@intel.com>
Fri, 5 Feb 2016 17:51:21 +0000 (17:51 +0000)
The admin page for user profiles have a field "Maintainer projects"
to grant maintainer rights to an user. It is a list of available
projects. When a project was selected, it was impossible to revoke.
It is now possible to unselect by clicking while holding the "Ctrl"
key.

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Acked-by: Stephen Finucane <stephen.finucane@intel.com>
patchwork/migrations/0005_unselectable_maintainer_projects.py [new file with mode: 0644]
patchwork/models.py

diff --git a/patchwork/migrations/0005_unselectable_maintainer_projects.py b/patchwork/migrations/0005_unselectable_maintainer_projects.py
new file mode 100644 (file)
index 0000000..d7b66b3
--- /dev/null
@@ -0,0 +1,19 @@
+# -*- coding: utf-8 -*-
+from __future__ import unicode_literals
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('patchwork', '0004_add_delegation_rule_model'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='userprofile',
+            name='maintainer_projects',
+            field=models.ManyToManyField(related_name='maintainer_project', to='patchwork.Project', blank=True),
+        ),
+    ]
index 88af2f0fe84702174273381acaa126b11334b0f0..5686ec87774ea2df8e9d41b220427d93e49e78d4 100644 (file)
@@ -111,7 +111,7 @@ class UserProfile(models.Model):
     user = models.OneToOneField(User, unique=True, related_name='profile')
     primary_project = models.ForeignKey(Project, null=True, blank=True)
     maintainer_projects = models.ManyToManyField(
-        Project, related_name='maintainer_project')
+        Project, related_name='maintainer_project', blank=True)
     send_email = models.BooleanField(
         default=False,
         help_text='Selecting this option allows patchwork to send email on'