Refactor cell_type in compute/api.py

TrivialFix

Change-Id: I0dc9dada728105c744a23d18e47e0185c5e0d5c3
This commit is contained in:
zhubx007 2018-08-08 18:29:04 +08:00
parent e8a73c4008
commit 8daa98eaac

View File

@ -275,11 +275,7 @@ class API(base.Base):
@property
def cell_type(self):
try:
return getattr(self, '_cell_type')
except AttributeError:
self._cell_type = cells_opts.get_cell_type()
return self._cell_type
return getattr(self, '_cell_type', cells_opts.get_cell_type())
def _validate_cell(self, instance):
if self.cell_type != 'api':