index is an str

This commit is contained in:
Emmanuel Garette 2019-04-04 19:34:16 +02:00
parent dae6779e72
commit 34e7a86130
1 changed files with 1 additions and 2 deletions

View File

@ -627,7 +627,6 @@ class Config:
def is_hidden(self,
path: str,
index: Optional[int]) -> bool:
property_ = 'hidden'
for property_, needs in {'hidden': True, 'display': False}.items():
if property_ in self.temp.get(path, {}):
value = self.temp[path][property_]
@ -638,7 +637,7 @@ class Config:
elif self.model.get(path, {}).get(property_, None) == needs:
return True
index = str(index)
if index is not None and index in self.model.get(path, {}) and self.model.get(path, {}).get(index, {}).get(property_, None) == needs:
if index != 'None' and index in self.model.get(path, {}) and self.model.get(path, {}).get(index, {}).get(property_, None) == needs:
return True
return False