Skip to content
This repository was archived by the owner on Oct 22, 2019. It is now read-only.
This repository was archived by the owner on Oct 22, 2019. It is now read-only.

limit_choices_to don't play well with ModelChoiceField #7

@avoine

Description

@avoine

Using limit_choices_to cause a validation error when you save tasks because it's used by the ForeignKey validation.

I suggest to remove the limit_choices_to constraint since you validate the input with your form already.
I'm not sure if this have consequences else where.

By the way, that for sharing your project :)

diff --git a/bltask/models.py b/bltask/models.py
index 6b7e977..be5bacd 100644
--- a/bltask/models.py
+++ b/bltask/models.py
@@ -69,7 +69,6 @@ class Task(MP_Node):
                                     null=True,
                                     blank=True,
                                     related_name='assigned_tasks',
-                                    limit_choices_to={'project_members__slug': 'self.tasks.slug'},
                                     verbose_name=_(u'assigned to'))
     
     created_by = models.ForeignKey(User,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions