Skip to content

Commit f3dd243

Browse files
authored
Merge branch 'develop' into FIX/pdf_view
2 parents 4bcd757 + 458d4d6 commit f3dd243

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

app/hackathon_variables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Hackathon timezone
1111
TIME_ZONE = 'CET'
1212
# This description will be used on the html and sharing meta tags
13-
HACKATHON_DESCRIPTION = 'Join us for BarcelonaTech\'s hackathon. 36h. May 12 - 14.'
13+
HACKATHON_DESCRIPTION = 'Join us for BarcelonaTech\'s hackathon. 36h. May 3 - 5.'
1414
# Domain where application is deployed, can be set by env variable
1515
HACKATHON_DOMAIN = os.environ.get('DOMAIN', None)
1616
HEROKU_APP_NAME = os.environ.get('HEROKU_APP_NAME', None)

applications/forms/hacker.py

+19-2
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def clean_projects(self):
101101

102102
cvs_edition = forms.BooleanField(
103103
required=False,
104-
label='I authorize "Hackers at UPC" to share my CV with HackUPC 2023 Sponsors.',
104+
label='I authorize "Hackers at UPC" to share my CV with HackUPC 2024 Sponsors.',
105105
)
106106

107107
def __init__(
@@ -224,7 +224,24 @@ class Meta(_BaseApplicationForm.Meta):
224224
"Please type following this schema: <strong>city, province, country</strong>",
225225
}
226226

227+
class CustomSelect(forms.Select):
228+
def create_option(
229+
self, name, value, label, selected, index, subindex=None, attrs=None
230+
):
231+
if index == 0:
232+
attrs = {"disabled": "disabled"}
233+
return super().create_option(
234+
name, value, label, selected, index, subindex=subindex, attrs=attrs
235+
)
236+
237+
def clean_discover(self):
238+
discover = self.cleaned_data.get("discover")
239+
if discover == "":
240+
raise forms.ValidationError("Please select an option.")
241+
return discover
242+
227243
discover_choices = (
244+
("", "- Select an option -"),
228245
(1, "HackUPC's social media"),
229246
(2, "Through your university (social media, emails...)"),
230247
(3, "Friends"),
@@ -239,7 +256,7 @@ class Meta(_BaseApplicationForm.Meta):
239256
"origin": forms.TextInput(attrs={"autocomplete": "off"}),
240257
"description": forms.Textarea(attrs={"rows": 3, "cols": 40}),
241258
"projects": forms.Textarea(attrs={"rows": 3, "cols": 40}),
242-
"discover": forms.Select(choices=discover_choices),
259+
"discover": CustomSelect(choices=discover_choices),
243260
"graduation_year": forms.RadioSelect(),
244261
}
245262

0 commit comments

Comments
 (0)