You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You MUST use this template when reporting issues. Please make sure you follow the checklist and fill in all of the information sections below.
All versions of django-smart-selects prior to version 1.2.8 are vulnerable to an XSS attack as detailed in issue 171. As a result, all previous versions have been removed from PyPI to prevent users from installing insecure versions. All users are urged to upgrade as soon as possible.
Checklist
Put an x in the bracket when you have completed each task, like this: [x]
This issue is not about installing previous versions of django-smart-selects older than 1.2.8. I understand that previous versions are insecure and will not receive any support whatsoever.
I have verified that that issue exists against the master branch of django-smart-selects.
I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
I have debugged the issue to the smart_selects app.
I have reduced the issue to the simplest possible case.
I have included all relevant sections of models.py, forms.py, and views.py with problems.
ChainedManytoManyField not working with inline forms
Expected behavior
Tested with Python 3.8 / Django 3.2 / django-smarts-selects last version 1.5.9
Code in models.py
# Test many to many with inlines and formsets
class Person(models.Model):
name = models.CharField(max_length=128)
def __str__(self):
return "%s" % self.name
class Group(models.Model):
name = models.CharField(max_length=128)
members = models.ManyToManyField(Person, through="Membership")
def __str__(self):
return "%s" % self.name
class Talent(models.Model):
name = models.CharField(max_length=64)
persons = models.ManyToManyField(Person, blank=True)
def __str__(self):
return "%s" % self.name
class Membership(models.Model):
person = models.ForeignKey(Person, on_delete=models.CASCADE)
group = models.ForeignKey(Group, on_delete=models.CASCADE)
talents = ChainedManyToManyField(
Talent, chained_field="person", chained_model_field="persons", horizontal=True
)
date_joined = models.DateField()
Code admin.py
class MembershipInline(admin.TabularInline):
model = Membership
extra = 1
class PersonAdmin(admin.ModelAdmin):
list_display = ("name",)
class GroupAdmin(admin.ModelAdmin):
inlines = (MembershipInline,)
class TalentAdmin(admin.ModelAdmin):
list_display = ("name",)
When I try to add a new membership, it does not load relationship data within inline forms when selecting person
ChainedForeingKey works, but ChainedManytoManyField fails. The console and network do not throw any errors.
Please, any solution?
The text was updated successfully, but these errors were encountered:
raftorres
changed the title
ManytoManyField not working with inline forms
ChainedManytoManyField not working with inline forms
Oct 24, 2021
You MUST use this template when reporting issues. Please make sure you follow the checklist and fill in all of the information sections below.
All versions of django-smart-selects prior to version 1.2.8 are vulnerable to an XSS attack as detailed in issue 171. As a result, all previous versions have been removed from PyPI to prevent users from installing insecure versions. All users are urged to upgrade as soon as possible.
Checklist
Put an
x
in the bracket when you have completed each task, like this:[x]
master
branch of django-smart-selects.smart_selects
app.models.py
,forms.py
, andviews.py
with problems.Steps to reproduce
Actual behavior
ChainedManytoManyField not working with inline forms
Expected behavior
Tested with Python 3.8 / Django 3.2 / django-smarts-selects last version 1.5.9
Code in models.py
Code admin.py
When I try to add a new membership, it does not load relationship data within inline forms when selecting person
ChainedForeingKey works, but ChainedManytoManyField fails. The console and network do not throw any errors.
Please, any solution?
The text was updated successfully, but these errors were encountered: