Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix __init__ in XtdCommentForm to keep origin fields parameters #315

Merged
merged 1 commit into from Jun 17, 2021

Conversation

dest81
Copy link
Contributor

@dest81 dest81 commented Jun 16, 2021

We shouldn't override the whole form field, we need only change particular attribute(s) of the field. For example in original CommentForm field name has max_length attribute which we are loosing/overriding in current code:

self.fields['name'] = forms.CharField(
            label=_("Name"),
            widget=forms.TextInput(attrs={'placeholder': _('name'),
                                          'class': 'form-control'}))

Solution is to change only widget and not whole field:

 self.fields['name'].widget = forms.TextInput(
            attrs={'placeholder': _('name'), 'class': 'form-control'})

@danirus danirus merged commit ad01e87 into danirus:master Jun 17, 2021
@danirus danirus mentioned this pull request Jun 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants