Skip to content
Snippets Groups Projects
Commit 4c55eda6 authored by Liorithiel's avatar Liorithiel
Browse files

Do not destroy a form twice.

parent b7261d39
No related branches found
No related tags found
No related merge requests found
...@@ -111,6 +111,9 @@ def show(self): ...@@ -111,6 +111,9 @@ def show(self):
# we have actually two different kinds of data forms: one is a simple form to fill, # we have actually two different kinds of data forms: one is a simple form to fill,
# second is a table with several records; # second is a table with several records;
def empty_method(self):
pass
def clean_data_form(self): def clean_data_form(self):
'''Remove data about existing form. This metod is empty, because '''Remove data about existing form. This metod is empty, because
it is rewritten by build_*_data_form, according to type of form it is rewritten by build_*_data_form, according to type of form
...@@ -136,6 +139,7 @@ def clean_single_data_form(self): ...@@ -136,6 +139,7 @@ def clean_single_data_form(self):
'''(Called as clean_data_form, read the docs of clean_data_form()). '''(Called as clean_data_form, read the docs of clean_data_form()).
Remove form from widget.''' Remove form from widget.'''
self.singleform.destroy() self.singleform.destroy()
self.clean_data_form = self.empty_method # we won't call it twice
del self.singleform del self.singleform
def build_multiple_data_form(self): def build_multiple_data_form(self):
...@@ -183,6 +187,7 @@ def build_multiple_data_form(self): ...@@ -183,6 +187,7 @@ def build_multiple_data_form(self):
def clean_multiple_data_form(self): def clean_multiple_data_form(self):
'''(Called as clean_data_form, read the docs of clean_data_form()). '''(Called as clean_data_form, read the docs of clean_data_form()).
Remove form from widget.''' Remove form from widget.'''
self.clean_data_form = self.empty_method # we won't call it twice
del self.multiplemodel del self.multiplemodel
def refresh_multiple_buttons(self): def refresh_multiple_buttons(self):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment