fix format of file
This commit is contained in:
parent
e8b957c697
commit
3af2645706
|
@ -1458,7 +1458,11 @@ class UploadPlaceholderForm(FlaskForm):
|
||||||
for k, v in x.items():
|
for k, v in x.items():
|
||||||
data[head[i]][k] = v[i]
|
data[head[i]][k] = v[i]
|
||||||
else:
|
else:
|
||||||
data = pd.read_excel(_file).to_dict()
|
try:
|
||||||
|
data = pd.read_excel(_file).to_dict()
|
||||||
|
except ValueError:
|
||||||
|
self.placeholder_file.errors = ["File don't have a correct format"]
|
||||||
|
return False
|
||||||
|
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
@ -1472,6 +1476,8 @@ class UploadPlaceholderForm(FlaskForm):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
data = self.get_data_file()
|
data = self.get_data_file()
|
||||||
|
if not data:
|
||||||
|
return False
|
||||||
|
|
||||||
header = [
|
header = [
|
||||||
'Phid',
|
'Phid',
|
||||||
|
|
Reference in New Issue