From: Thomas Monjalon Date: Sat, 30 Jan 2016 15:34:34 +0000 (+0100) Subject: models: Allow to unselect maintainer projects in user profile X-Git-Tag: v1.1.0~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f83cc5829852142f1eba988ee01af49f4869489b;p=thirdparty%2Fpatchwork.git models: Allow to unselect maintainer projects in user profile 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 Acked-by: Stephen Finucane --- diff --git a/patchwork/migrations/0005_unselectable_maintainer_projects.py b/patchwork/migrations/0005_unselectable_maintainer_projects.py new file mode 100644 index 00000000..d7b66b32 --- /dev/null +++ b/patchwork/migrations/0005_unselectable_maintainer_projects.py @@ -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), + ), + ] diff --git a/patchwork/models.py b/patchwork/models.py index 88af2f0f..5686ec87 100644 --- a/patchwork/models.py +++ b/patchwork/models.py @@ -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'