Commit feae17a6 by Czémán Arnold

dashboard: small grant works in storage views

parent f068881e
...@@ -1643,6 +1643,7 @@ class DataStoreForm(ModelForm): ...@@ -1643,6 +1643,7 @@ class DataStoreForm(ModelForm):
class Meta: class Meta:
model = DataStore model = DataStore
fields = ("type", "name", "path", "hostname", ) fields = ("type", "name", "path", "hostname", )
widgets = {"type": HiddenInput()}
class CephDataStoreForm(DataStoreForm): class CephDataStoreForm(DataStoreForm):
......
...@@ -29,7 +29,7 @@ from django_tables2 import SingleTableView ...@@ -29,7 +29,7 @@ from django_tables2 import SingleTableView
from django.http import Http404, HttpResponse from django.http import Http404, HttpResponse
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from braces.views import SuperuserRequiredMixin, LoginRequiredMixin from braces.views import SuperuserRequiredMixin
from sizefield.utils import filesizeformat from sizefield.utils import filesizeformat
from common.models import WorkerNotFound from common.models import WorkerNotFound
...@@ -46,7 +46,7 @@ from celery.exceptions import TimeoutError ...@@ -46,7 +46,7 @@ from celery.exceptions import TimeoutError
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
class StorageChoose(LoginRequiredMixin, TemplateView): class StorageChoose(SuperuserRequiredMixin, TemplateView):
def get_template_names(self): def get_template_names(self):
if self.request.is_ajax(): if self.request.is_ajax():
...@@ -139,7 +139,7 @@ class StorageCreate(SuccessMessageMixin, CreateView): ...@@ -139,7 +139,7 @@ class StorageCreate(SuccessMessageMixin, CreateView):
return fc return fc
class StorageList(LoginRequiredMixin, FilterMixin, SingleTableView): class StorageList(SuperuserRequiredMixin, FilterMixin, SingleTableView):
template_name = "dashboard/storage-list.html" template_name = "dashboard/storage-list.html"
model = DataStore model = DataStore
table_class = StorageListTable table_class = StorageListTable
...@@ -342,4 +342,4 @@ class DataStoreHostCreate(SuccessMessageMixin, CreateView): ...@@ -342,4 +342,4 @@ class DataStoreHostCreate(SuccessMessageMixin, CreateView):
return error_str return error_str
def get_success_url(self): def get_success_url(self):
return reverse_lazy("dashboard.views.storage-list") # TODO return reverse_lazy("dashboard.views.storage-list")
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