File tree Expand file tree Collapse file tree 2 files changed +40
-7
lines changed Expand file tree Collapse file tree 2 files changed +40
-7
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,22 @@ class Meta:
4848
4949 def __init__ (self , * args , ** kwargs ):
5050 super (ApiUserCreationForm , self ).__init__ (* args , ** kwargs )
51- self .fields ["email" ].required = True
51+ email_field = self .fields ["email" ]
52+ first_name_field = self .fields ["first_name" ]
53+ last_name_field = self .fields ["last_name" ]
54+ email_field .required = True
55+ email_field .label = "Email"
56+ email_field .widget .attrs ["class" ] = "input"
57+ email_field .widget .attrs ["style" ] = "width: 50%"
58+ email_field .
widget .
attrs [
"placeholder" ]
= "e.g. [email protected] " 59+ first_name_field .label = "First Name"
60+ first_name_field .widget .attrs ["class" ] = "input"
61+ first_name_field .widget .attrs ["style" ] = "width: 50%"
62+ first_name_field .widget .attrs ["placeholder" ] = "e.g. Jon"
63+ last_name_field .label = "Last Name"
64+ last_name_field .widget .attrs ["class" ] = "input"
65+ last_name_field .widget .attrs ["style" ] = "width: 50%"
66+ last_name_field .widget .attrs ["placeholder" ] = "e.g. Doe"
5267
5368 def save (self , commit = True ):
5469 return ApiUser .objects .create_api_user (
Original file line number Diff line number Diff line change 1111 </ div >
1212 </ article >
1313 {% endfor %}
14- {% block title %}
15- VulnerableCode API key request
16- {% endblock %}
14+ < div id ="form-errors " class ="message is-danger {% if not form.errors %}is-hidden{% endif %} ">
15+ {% for field_name, errors in form.errors.items %}
16+ < div class ="message-body ">
17+ {{ errors }}
18+ </ div >
19+ {% endfor %}
20+ </ div >
21+ < h2 class ="subtitle mb-0 pt-2 mb-2 ">
22+ < b > VulnerableCode API key request</ b >
23+ </ h2 >
24+
25+ < section class ="ml-2 mt-3 pr-4 pt-4 pl-4 pb-4 has-background-light has-border-radius ">
26+ Please provide your < b > email address</ b > and we will email you the < b > API token</ b > .
27+ </ section >
28+
1729 < br />
1830 < form action = "" method = "post ">
1931 {% csrf_token %}
20- {{form|crispy }}
21- < br />
22- < input class ="button is-link " type ="submit " value ="Submit ">
32+ {% for field in form %}
33+ < div class ="field mt-2 ">
34+ < label class ="label " for ="{{ form.name.id_for_label }} "> {{ field.label }}</ label >
35+ < div class ="control ">
36+ {{ field }}
37+ </ div >
38+ </ div >
39+ {% endfor %}
40+ < input class ="button is-link mt-5 " type ="submit " value ="Request my API Key ">
2341 </ form >
2442 </ section >
2543{% endblock %}
You can’t perform that action at this time.
0 commit comments