Commit f3ff40ed by Czémán Arnold

storage: small rework on get_default_datastore()

parent 0dbe809a
Pipeline #156 failed with stage
in 0 seconds
...@@ -113,13 +113,9 @@ class DataStore(Model): ...@@ -113,13 +113,9 @@ class DataStore(Model):
@classmethod @classmethod
def get_default_datastore(cls): def get_default_datastore(cls):
try:
datastore_name = settings.DEFAULT_DATASTORE datastore_name = settings.DEFAULT_DATASTORE
if datastore_name: if datastore_name:
return cls.objects.get(name=datastore_name) return cls.objects.get(name=datastore_name)
except cls.DoesNotExist:
pass
return cls.objects.all()[0] # TODO
class Disk(TimeStampedModel): 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