diff --git a/app/hackathon_variables.py b/app/hackathon_variables.py index 493b10f8..66f08972 100644 --- a/app/hackathon_variables.py +++ b/app/hackathon_variables.py @@ -4,61 +4,72 @@ from django.utils import timezone -HACKATHON_NAME = 'HackUPC' +HACKATHON_NAME = "HackUPC" # What's the name for the application -HACKATHON_APPLICATION_NAME = 'My HackUPC' +HACKATHON_APPLICATION_NAME = "My HackUPC" # Hackathon timezone -TIME_ZONE = 'CET' +TIME_ZONE = "CET" # This description will be used on the html and sharing meta tags -HACKATHON_DESCRIPTION = 'Join us for BarcelonaTech\'s hackathon. 36h. May 3 - 5.' +HACKATHON_DESCRIPTION = "Join us for BarcelonaTech's hackathon. 36h. April 24 - 26." # Domain where application is deployed, can be set by env variable -HACKATHON_DOMAIN = os.environ.get('DOMAIN', None) -HEROKU_APP_NAME = os.environ.get('HEROKU_APP_NAME', None) +HACKATHON_DOMAIN = os.environ.get("DOMAIN", None) +HEROKU_APP_NAME = os.environ.get("HEROKU_APP_NAME", None) if HEROKU_APP_NAME and not HACKATHON_DOMAIN: - HACKATHON_DOMAIN = '%s.herokuapp.com' % HEROKU_APP_NAME + HACKATHON_DOMAIN = "%s.herokuapp.com" % HEROKU_APP_NAME elif not HACKATHON_DOMAIN: - HACKATHON_DOMAIN = 'localhost:8000' + HACKATHON_DOMAIN = "localhost:8000" # Hackathon contact email: where should all hackers contact you. It will also be used as a sender for all emails -HACKATHON_CONTACT_EMAIL = 'contact@hackupc.com' +HACKATHON_CONTACT_EMAIL = "contact@hackupc.com" # Hackathon logo url, will be used on all emails -HACKATHON_LOGO_URL = 'https://my.hackupc.com/static/logo.png' +HACKATHON_LOGO_URL = "https://my.hackupc.com/static/logo.png" -HACKATHON_OG_IMAGE = 'https://hackupc.com/ogimage.png?v=2021' +HACKATHON_OG_IMAGE = "https://hackupc.com/ogimage.png?v=2021" # (OPTIONAL) Track visits on your website -HACKATHON_GOOGLE_ANALYTICS = 'UA-69542332-2' +HACKATHON_GOOGLE_ANALYTICS = "UA-69542332-2" # (OPTIONAL) Hackathon Twitter user -HACKATHON_TWITTER_ACCOUNT = 'hackupc' +HACKATHON_TWITTER_ACCOUNT = "hackupc" # (OPTIONAL) Hackathon Facebook page -HACKATHON_FACEBOOK_PAGE = 'hackupc' +HACKATHON_FACEBOOK_PAGE = "hackupc" # (OPTIONAL) Hackathon YouTube channel -HACKATHON_YOUTUBE_PAGE = 'UCiiRorGg59Xd5Sjj9bjIt-g' +HACKATHON_YOUTUBE_PAGE = "UCiiRorGg59Xd5Sjj9bjIt-g" # (OPTIONAL) Hackathon Instagram user -HACKATHON_INSTAGRAM_ACCOUNT = 'hackupc' +HACKATHON_INSTAGRAM_ACCOUNT = "hackupc" # (OPTIONAL) Hackathon Medium user -HACKATHON_MEDIUM_ACCOUNT = 'hackupc' +HACKATHON_MEDIUM_ACCOUNT = "hackupc" # (OPTIONAL) Github Repo for this project (so meta) -HACKATHON_GITHUB_REPO = 'https://github.com/hackupc/myhackupc/' +HACKATHON_GITHUB_REPO = "https://github.com/hackupc/myhackupc/" # (OPTIONAL) Applications deadline -HACKATHON_APP_DEADLINE = timezone.datetime(2030, 4, 24, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE)) -VOLUNTEER_APP_DEADLINE = timezone.datetime(2030, 4, 18, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE)) -MENTOR_APP_DEADLINE = timezone.datetime(2030, 3, 25, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE)) +HACKATHON_APP_DEADLINE = timezone.datetime( + 2026, 4, 1, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) +VOLUNTEER_APP_DEADLINE = timezone.datetime( + 2026, 3, 27, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) +MENTOR_APP_DEADLINE = timezone.datetime( + 2026, 3, 27, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) + # (OPTIONAL) Online checkin activated -ONLINE_CHECKIN = timezone.datetime(2020, 5, 3, 17, 00, tzinfo=timezone.pytz.timezone(TIME_ZONE)) +ONLINE_CHECKIN = timezone.datetime( + 2020, 5, 3, 17, 00, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) # (OPTIONAL) When to arrive at the hackathon -HACKATHON_ARRIVE = '' +HACKATHON_ARRIVE = "" # (OPTIONAL) When to arrive at the hackathon -HACKATHON_LEAVE = '' +HACKATHON_LEAVE = "" # (OPTIONAL) Hackathon live page -HACKATHON_LIVE_PAGE = 'https://live.hackupc.com' +HACKATHON_LIVE_PAGE = "https://live.hackupc.com" # (OPTIONAL) Regex to automatically match organizers emails and set them as organizers when signing up -REGEX_HACKATHON_ORGANIZER_EMAIL = '^.*@hackupc\.com$' +REGEX_HACKATHON_ORGANIZER_EMAIL = "^.*@hackupc\.com$" # (OPTIONAL) Send 500 errors to email while on production mode -HACKATHON_DEV_EMAILS = ['devs@hackupc.com', ] +HACKATHON_DEV_EMAILS = [ + "devs@hackupc.com", +] # Baggage configuration BAGGAGE_ENABLED = True @@ -67,10 +78,14 @@ # Reimbursement configuration REIMBURSEMENT_ENABLED = True DEFAULT_REIMBURSEMENT_AMOUNT = 100 -CURRENCY = '€' -REIMBURSEMENT_EXPIRY_DATE = timezone.datetime(2025, 5, 2, 17, 00, tzinfo=timezone.pytz.timezone(TIME_ZONE)) -REIMBURSEMENT_REQUIREMENTS = 'You have to submit a project and demo it during the event in order to get reimbursed' -REIMBURSEMENT_DEADLINE = timezone.datetime(2025, 5, 5, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE)) +CURRENCY = "€" +REIMBURSEMENT_EXPIRY_DATE = timezone.datetime( + 2025, 5, 2, 17, 00, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) +REIMBURSEMENT_REQUIREMENTS = "You have to submit a project and demo it during the event in order to get reimbursed" +REIMBURSEMENT_DEADLINE = timezone.datetime( + 2025, 5, 5, 23, 59, tzinfo=timezone.pytz.timezone(TIME_ZONE) +) # (OPTIONAL) Max team members. Defaults to 4 TEAMS_ENABLED = True @@ -82,9 +97,9 @@ # (OPTIONAL) Slack credentials # Highly recommended to create a separate user account to extract the token from SLACK = { - 'team': os.environ.get('SL_TEAM', 'test'), + "team": os.environ.get("SL_TEAM", "test"), # Get it here: https://api.slack.com/custom-integrations/legacy-tokens - 'token': os.environ.get('SL_TOKEN', None) + "token": os.environ.get("SL_TOKEN", None), } # (OPTIONAL) Logged in cookie @@ -95,16 +110,16 @@ # Hardware configuration # Hardware request time length (in minutes) HARDWARE_ENABLED = True -#Hardware request time length (in minutes) +# Hardware request time length (in minutes) HARDWARE_REQUEST_TIME = 15 SLACK_BOT = { - 'id': os.environ.get('SL_BOT_ID', None), - 'token': os.environ.get('SL_BOT_TOKEN', None), - 'channel': os.environ.get('SL_BOT_CHANNEL', None), - 'director1': os.environ.get('SL_BOT_DIRECTOR1', None), - 'director2': os.environ.get('SL_BOT_DIRECTOR2', None) + "id": os.environ.get("SL_BOT_ID", None), + "token": os.environ.get("SL_BOT_TOKEN", None), + "channel": os.environ.get("SL_BOT_CHANNEL", None), + "director1": os.environ.get("SL_BOT_DIRECTOR1", None), + "director2": os.environ.get("SL_BOT_DIRECTOR2", None), } # Enable judging tab JUDGING_ENABLED = False @@ -119,7 +134,7 @@ # Enable blacklist separate pipeline (disabled by default) BLACKLIST_ENABLED = True -SUPPORTED_RESUME_EXTENSIONS = ['.pdf'] +SUPPORTED_RESUME_EXTENSIONS = [".pdf"] # Mentor/Volunteer applications can expire if they are invited, set to False to not MENTOR_EXPIRES = False @@ -129,9 +144,9 @@ HYBRID_HACKATHON = False N_MAX_LIVE_HACKERS = 600 -SERVER_EMAIL = 'HackUPC Team ' +SERVER_EMAIL = "HackUPC Team " -CODE_CONDUCT_LINK = 'https://legal.hackersatupc.org/hackupc/code_of_conduct' -LEGAL_LINK = 'https://legal.hackersatupc.org/hackupc/legal_notice' -PRIVACY_LINK = 'https://legal.hackersatupc.org/hackupc/privacy_and_cookies' -TERMS_LINK = 'https://legal.hackersatupc.org/hackupc/terms_and_conditions' +CODE_CONDUCT_LINK = "https://legal.hackersatupc.org/hackupc/code_of_conduct" +LEGAL_LINK = "https://legal.hackersatupc.org/hackupc/legal_notice" +PRIVACY_LINK = "https://legal.hackersatupc.org/hackupc/privacy_and_cookies" +TERMS_LINK = "https://legal.hackersatupc.org/hackupc/terms_and_conditions" diff --git a/app/templates/base.html b/app/templates/base.html index 1a6d4b2b..de022856 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -111,10 +111,8 @@ {% endif %} {% if request.user.is_organizer %} - {% if request.user.has_volunteer_access %} -
  • Volunteer
  • - {% endif %} +
  • Volunteer
  • {% if request.user.has_mentor_access %}
  • Mentor
  • diff --git a/organizers/templates/other_application_detail.html b/organizers/templates/other_application_detail.html index 8a2bf232..0978fe01 100644 --- a/organizers/templates/other_application_detail.html +++ b/organizers/templates/other_application_detail.html @@ -20,7 +20,7 @@

    Personal

    {% include 'include/field.html' with desc='Name' value=app.name %} {% elif app.user.is_volunteer %} {% include 'include/field.html' with desc='Name' value=app.user.name %} - {% include 'include/field.html' with desc='Is over 18?' value=app.under_age|yesno %} + {% include 'include/field.html' with desc='Is underage?' value=app.under_age|yesno %} {% include 'include/field.html' with desc='Studies and course/graduation' value=app.studies_and_course %} {% else %} {% include 'include/field.html' with desc='Name' value=app.user.name %} @@ -35,7 +35,7 @@

    Personal

    {% include 'include/field.html' with desc='Gender' value=app.get_gender_display %} {% include 'include/field.html' with desc='Other gender' value=app.other_gender %} {% include 'include/field.html' with desc='In BCN Apr-May' value=app.lennyface|yesno %} -
    +

    Validation

    @@ -45,16 +45,18 @@

    Validation

    {% csrf_token %} - + {% if user.has_volunteer_access %} + + {% endif %}

    -
    +

    Volunteering

    @@ -188,7 +190,7 @@

    {{ comment.text }}

    {% csrf_token %} + rows="3" required maxlength="500"> @@ -198,28 +200,29 @@

    {{ comment.text }}

    {% block out_panel %} {% if app and not app.user.is_sponsor %} - - + {% if app and app.user.is_volunteer and not user.has_volunteer_access %} + {% else %} + + {% endif %} {% endif %} {% endblock %} diff --git a/organizers/views.py b/organizers/views.py index 01c6a18d..84e4ff23 100644 --- a/organizers/views.py +++ b/organizers/views.py @@ -61,7 +61,6 @@ IsOrganizerMixin, IsDirectorMixin, HaveDubiousPermissionMixin, - HaveVolunteerPermissionMixin, HaveSponsorPermissionMixin, HaveMentorPermissionMixin, IsBlacklistAdminMixin, @@ -85,7 +84,9 @@ def add_vote(application, user, tech_rat, pers_rat): v.save() votes_count = application.vote_set.count() if votes_count >= 5 and not application.cv_flagged: - AcceptedResume.objects.update_or_create(application=application, defaults={'accepted': True}) + AcceptedResume.objects.update_or_create( + application=application, defaults={"accepted": True} + ) return v @@ -359,12 +360,12 @@ def post(self, request, *args, **kwargs): id_ = request.POST.get("app_id") application = models.HackerApplication.objects.get(pk=id_) - comment_text = request.POST.get('comment_text', None) - motive_of_ban = request.POST.get('motive_of_ban', None) - dubious_type = request.POST.get('dubious_type', None) - dubious_comment_text = request.POST.get('dubious_comment_text', None) + comment_text = request.POST.get("comment_text", None) + motive_of_ban = request.POST.get("motive_of_ban", None) + dubious_type = request.POST.get("dubious_type", None) + dubious_comment_text = request.POST.get("dubious_comment_text", None) - if request.POST.get('add_comment'): + if request.POST.get("add_comment"): add_comment(application, request.user, comment_text) elif request.POST.get("invite") and request.user.is_director: self.invite_application(application) @@ -376,7 +377,7 @@ def post(self, request, *args, **kwargs): self.waitlist_application(application) elif request.POST.get("slack") and request.user.is_organizer: self.slack_invite(application) - elif request.POST.get('set_dubious') and request.user.is_organizer: + elif request.POST.get("set_dubious") and request.user.is_organizer: application.set_dubious(request.user, dubious_type, dubious_comment_text) elif request.POST.get("set_flagged_cv") and request.user.is_organizer: application.set_flagged_cv() @@ -510,8 +511,8 @@ def post(self, request, *args, **kwargs): tech_vote = request.POST.get("tech_rat", None) pers_vote = request.POST.get("pers_rat", None) comment_text = request.POST.get("comment_text", None) - dubious_type = request.POST.get('dubious_type', None) - dubious_comment_text = request.POST.get('dubious_comment_text', None) + dubious_type = request.POST.get("dubious_type", None) + dubious_comment_text = request.POST.get("dubious_comment_text", None) application = models.HackerApplication.objects.get( pk=request.POST.get("app_id") @@ -525,7 +526,9 @@ def post(self, request, *args, **kwargs): "/applications/hacker/review/" + application.uuid_str ) elif request.POST.get("set_dubious"): - application.set_dubious(request.user, dubious_type, dubious_comment_text) + application.set_dubious( + request.user, dubious_type, dubious_comment_text + ) elif request.POST.get("unset_dubious"): application.unset_dubious() elif request.POST.get("set_flagged_cv") and request.user.is_organizer: @@ -615,8 +618,8 @@ def post(self, request, *args, **kwargs): tech_vote = request.POST.get("tech_rat", None) pers_vote = request.POST.get("pers_rat", None) comment_text = request.POST.get("comment_text", None) - dubious_type = request.POST.get('dubious_type', None) - dubious_comment_text = request.POST.get('dubious_comment_text', None) + dubious_type = request.POST.get("dubious_type", None) + dubious_comment_text = request.POST.get("dubious_comment_text", None) application = models.HackerApplication.objects.get( pk=request.POST.get("app_id") @@ -630,7 +633,9 @@ def post(self, request, *args, **kwargs): "/applications/hacker/review/" + application.uuid_str ) elif request.POST.get("set_dubious"): - application.set_dubious(request.user, dubious_type, dubious_comment_text) + application.set_dubious( + request.user, dubious_type, dubious_comment_text + ) elif request.POST.get("unset_dubious"): application.unset_dubious() elif request.POST.get("set_flagged_cv") and request.user.is_organizer: @@ -846,9 +851,7 @@ def get_context_data(self, **kwargs): return context -class VolunteerApplicationsListView( - HaveVolunteerPermissionMixin, _OtherApplicationsListView -): +class VolunteerApplicationsListView(IsOrganizerMixin, _OtherApplicationsListView): table_class = VolunteerListTable filterset_class = VolunteerFilter @@ -912,9 +915,7 @@ def get_current_tabs(self): return mentor_tabs(self.request.user) -class ReviewVolunteerApplicationView( - TabsViewMixin, HaveVolunteerPermissionMixin, TemplateView -): +class ReviewVolunteerApplicationView(IsOrganizerMixin, TabsViewMixin, TemplateView): template_name = "other_application_detail.html" def get_application(self, kwargs):