Skip to content

Commit

Permalink
Add email input field to GPU booking form with placeholder and styling
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneBendazzoli93 committed Feb 9, 2025
1 parent 1573a2e commit 2b23ecf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion dashboard/apps/gpu_scheduler/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from datetime import datetime, timezone
from .forms import GPUBookingForm
from MAIA.dashboard_utils import get_namespaces

from django import forms

@method_decorator(csrf_exempt, name='dispatch') # 🚀 This disables CSRF for this API
class GPUSchedulabilityAPIView(APIView):
Expand Down Expand Up @@ -119,6 +119,14 @@ def book_gpu(request):
else:
form = GPUBookingForm(request.POST or None, request.FILES or None, initial=initial_data)
form.fields['namespace'].choices = [(ns, ns) for ns in namespaces]
form.fields['user_email'] = forms.EmailField(
widget=forms.EmailInput(
attrs={
"placeholder": "Your Email.",
"class": "form-control",

}
))

return render(request, "accounts/gpu_booking.html", {"dashboard_version": settings.DASHBOARD_VERSION, "form": form, "msg": msg, "success": success})

Expand Down

0 comments on commit 2b23ecf

Please sign in to comment.