Skip to content

Commit aeda10a

Browse files
Update GPU booking form to use GPU specs and adjust booking retrieval for superusers
1 parent b1ec699 commit aeda10a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

dashboard/apps/gpu_scheduler/forms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def __init__(self, *args, **kwargs):
3333
))
3434

3535
self.fields['gpu'] = forms.ChoiceField(
36-
choices=[(gpu,gpu) for gpu in settings.GPU_LIST],
36+
choices=[(gpu['name'],gpu['name']) for gpu in settings.GPU_SPECS],
3737
widget=forms.Select(attrs={
3838
'class': "form-select text-center fw-bold",
3939
'style': 'max-width: auto;',

dashboard/apps/gpu_scheduler/views.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,11 @@ def gpu_booking_info(request):
171171
for group in groups:
172172
if str(group) != "MAIA:users":
173173
namespaces.append(str(group).split(":")[-1].lower().replace("_","-"))
174-
175-
bookings = GPUBooking.objects.filter(user_email=request.user.email)
174+
175+
if request.user.is_superuser:
176+
bookings = GPUBooking.objects.all()
177+
else:
178+
bookings = GPUBooking.objects.filter(user_email=request.user.email)
176179

177180

178181
bookings_dict = []

0 commit comments

Comments
 (0)