Commit f3ff40ed by Czémán Arnold

storage: small rework on get_default_datastore()

parent 0dbe809a
......@@ -113,13 +113,9 @@ class DataStore(Model):
@classmethod
def get_default_datastore(cls):
try:
datastore_name = settings.DEFAULT_DATASTORE
if datastore_name:
return cls.objects.get(name=datastore_name)
except cls.DoesNotExist:
pass
return cls.objects.all()[0] # TODO
datastore_name = settings.DEFAULT_DATASTORE
if datastore_name:
return cls.objects.get(name=datastore_name)
class Disk(TimeStampedModel):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment