Commit 1dee388d authored by Bryan  BRANCOTTE's avatar Bryan BRANCOTTE
Browse files

moving helper to the class

parent 608281c8
......@@ -4,6 +4,7 @@ import io
from basetheme_bootstrap.user_preferences import get_user_preferences_for_user
from crispy_forms import helper as crispy_forms_helper
from crispy_forms import layout as crispy_forms_layout
from crispy_forms.helper import FormHelper
from crispy_forms.layout import HTML
from django import forms
from django.contrib.auth import get_user_model
......@@ -773,10 +774,8 @@ class VirusHostDetailViewForm(CommonPrefBrowseForm):
class EmptyForm(forms.Form):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = crispy_forms_helper.FormHelper()
self.helper.form_tag = False
helper = FormHelper()
helper.form_tag = False
class DataSourceNameModelForm(forms.ModelForm):
......@@ -787,11 +786,12 @@ class DataSourceNameModelForm(forms.ModelForm):
'public',
)
helper = FormHelper()
helper.form_tag = False
def __init__(self, owner=None, *args, **kwargs):
self.owner = owner
super().__init__(*args, **kwargs)
self.helper = crispy_forms_helper.FormHelper()
self.helper.form_tag = False
def save(self, commit=True):
instance = super().save(commit=False)
......@@ -855,10 +855,8 @@ class DataSourceVisibilityModelForm(DataSourceUserCreateOrUpdateForm):
'allowed_users',
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = crispy_forms_helper.FormHelper()
self.helper.form_tag = False
helper = FormHelper()
helper.form_tag = False
class UploadOrLiveInput(forms.Form):
......@@ -872,11 +870,8 @@ class UploadOrLiveInput(forms.Form):
initial=None,
widget=forms.RadioSelect,
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = crispy_forms_helper.FormHelper()
self.helper.form_tag = False
helper = FormHelper()
helper.form_tag = False
class UploadDataSourceForm(ImportDataSourceForm):
......@@ -887,10 +882,8 @@ class UploadDataSourceForm(ImportDataSourceForm):
fields = (
)
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.helper = crispy_forms_helper.FormHelper()
self.helper.form_tag = False
helper = FormHelper()
helper.form_tag = False
DELIMITER_CHOICES = [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment