Skip to content

Commit 6e696ef

Browse files
committed
Updating url name and all references to it
1 parent 9ad2c97 commit 6e696ef

8 files changed

Lines changed: 28 additions & 28 deletions

File tree

hackadmin/views.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
@login_required
1717
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
1818
UserType.PARTNER_ADMIN],
19-
redirect_url='hackathon:hackathon-list')
19+
redirect_url='hackathon:list-hackathons')
2020
def hackadmin_panel(request):
2121
""" Used for admin to view all registered users and allows to filter
2222
by individual hackathon """
@@ -32,7 +32,7 @@ def hackadmin_panel(request):
3232
@login_required
3333
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
3434
UserType.PARTNER_ADMIN],
35-
redirect_url='hackathon:hackathon-list')
35+
redirect_url='hackathon:list-hackathons')
3636
def hackathon_participants(request, hackathon_id):
3737
""" Used for admin to view all registered users and allows to filter
3838
by individual hackathon """
@@ -64,7 +64,7 @@ def hackathon_participants(request, hackathon_id):
6464
@login_required
6565
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
6666
UserType.PARTNER_ADMIN],
67-
redirect_url='hackathon:hackathon-list')
67+
redirect_url='hackathon:list-hackathons')
6868
def all_users(request):
6969
""" Used for admin to view all registered users and allows to filter
7070
by individual hackathon """
@@ -81,7 +81,7 @@ def all_users(request):
8181
@login_required
8282
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
8383
UserType.PARTNER_ADMIN],
84-
redirect_url='hackathon:hackathon-list')
84+
redirect_url='hackathon:list-hackathons')
8585
def remove_participant(request, hackathon_id):
8686
if request.method == 'POST':
8787
remove_from_hackathon = (request.POST.get('remove_from_hackathon')
@@ -110,7 +110,7 @@ def remove_participant(request, hackathon_id):
110110
@login_required
111111
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
112112
UserType.PARTNER_ADMIN],
113-
redirect_url='hackathon:hackathon-list')
113+
redirect_url='hackathon:list-hackathons')
114114
def add_participant(request, hackathon_id):
115115
if request.method == 'POST':
116116
hackathon = get_object_or_404(Hackathon, id=hackathon_id)
@@ -128,7 +128,7 @@ def add_participant(request, hackathon_id):
128128
@login_required
129129
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
130130
UserType.PARTNER_ADMIN],
131-
redirect_url='hackathon:hackathon-list')
131+
redirect_url='hackathon:list-hackathons')
132132
def add_judge(request):
133133
if request.method == 'POST':
134134
hackathon = get_object_or_404(Hackathon,
16 KB
Binary file not shown.

hackathon/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323

2424
urlpatterns = [
25-
path('', list_hackathons, name="hackathon-list"),
25+
path('', list_hackathons, name="list-hackathons"),
2626
path("<int:hackathon_id>/team/<int:team_id>/judging/",
2727
judging, name="judging"),
2828
path("<int:hackathon_id>/final_score/", check_projects_scores,

hackathon/views.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def list_hackathons(request):
8888
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
8989
UserType.FACILITATOR_JUDGE, UserType.PARTNER_ADMIN,
9090
UserType.PARTNER_JUDGE],
91-
redirect_url='hackathon:hackathon-list')
91+
redirect_url='hackathon:list-hackathons')
9292
def judging(request, hackathon_id, team_id):
9393
"""Displays the judging page for the judge to save their scores
9494
for the selected project - determined by hackathon id and team id"""
@@ -172,7 +172,7 @@ def judging(request, hackathon_id, team_id):
172172

173173
@login_required
174174
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
175-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
175+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
176176
def check_projects_scores(request, hackathon_id):
177177
""" When a judge submits the score, check if all projects in the Hackathon
178178
were scored by all the judges in all the categories by comparing the
@@ -242,7 +242,7 @@ def check_projects_scores(request, hackathon_id):
242242

243243
@login_required
244244
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
245-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
245+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
246246
def create_hackathon(request):
247247
""" Allow users to create hackathon event """
248248
if request.method == 'GET':
@@ -300,12 +300,12 @@ def create_hackathon(request):
300300
logger.exception(form.errors)
301301
messages.error(request, ("An error occurred creating the event. "
302302
"Please try again."))
303-
return redirect("hackathon:hackathon-list")
303+
return redirect("hackathon:list-hackathons")
304304

305305

306306
@login_required
307307
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
308-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
308+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
309309
def update_hackathon(request, hackathon_id):
310310
""" Allow users to edit hackathon event """
311311
hackathon = get_object_or_404(Hackathon, pk=hackathon_id)
@@ -351,12 +351,12 @@ def update_hackathon(request, hackathon_id):
351351
else:
352352
messages.error(request, ("An error occurred updating the event. "
353353
"Please try again."))
354-
return redirect("hackathon:hackathon-list")
354+
return redirect("hackathon:list-hackathons")
355355

356356

357357
@login_required
358358
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
359-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
359+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
360360
def update_hackathon_status(request, hackathon_id):
361361
""" Allows users to updated the status of a hackathon """
362362
if request.method == 'POST':
@@ -369,7 +369,7 @@ def update_hackathon_status(request, hackathon_id):
369369
else:
370370
messages.error(request, ("An error occurred updating the event "
371371
"status. Please try again."))
372-
return redirect("hackathon:hackathon-list")
372+
return redirect("hackathon:list-hackathons")
373373

374374

375375
@login_required
@@ -424,7 +424,7 @@ def view_hackathon_public(request, hackathon_id):
424424

425425
@login_required
426426
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
427-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
427+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
428428
def delete_hackathon(request, hackathon_id):
429429
""" Allow users to 'soft delete' hackathon event - set status to 'deleted'
430430
to remove from frontend list """
@@ -437,7 +437,7 @@ def delete_hackathon(request, hackathon_id):
437437

438438
messages.success(
439439
request, f'{hackathon.display_name} has been successfully deleted!')
440-
return redirect("hackathon:hackathon-list")
440+
return redirect("hackathon:list-hackathons")
441441

442442

443443
@login_required
@@ -484,7 +484,7 @@ def enroll_toggle(request):
484484

485485
@login_required
486486
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
487-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
487+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
488488
def change_awards(request, hackathon_id):
489489
hackathon = get_object_or_404(Hackathon, pk=hackathon_id)
490490
awards = hackathon.awards.all()
@@ -536,7 +536,7 @@ def change_awards(request, hackathon_id):
536536
@can_access([UserType.SUPERUSER, UserType.STAFF, UserType.FACILITATOR_ADMIN,
537537
UserType.FACILITATOR_JUDGE, UserType.PARTNER_ADMIN,
538538
UserType.PARTNER_JUDGE],
539-
redirect_url='hackathon:hackathon-list')
539+
redirect_url='hackathon:list-hackathons')
540540
def judge_teams(request, hackathon_id):
541541
""" Shows the list of teams and allows a judge to go to the scoring
542542
page """
@@ -554,7 +554,7 @@ def judge_teams(request, hackathon_id):
554554

555555
@login_required
556556
@can_access([UserType.SUPERUSER, UserType.FACILITATOR_ADMIN,
557-
UserType.PARTNER_ADMIN], redirect_url='hackathon:hackathon-list')
557+
UserType.PARTNER_ADMIN], redirect_url='hackathon:list-hackathons')
558558
def assign_mentors(request, hackathon_id):
559559
""" View used to assign a mentor to each team """
560560
hackathon = get_object_or_404(Hackathon, id=hackathon_id)

home/templates/home/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
{% block content %}
88

9-
<div class="row mt-5 mb-0">
9+
<div class="row mt-0 mb-0">
1010
<div class="col">
1111

1212
<div class="container mb-5">
@@ -25,7 +25,7 @@
2525
{% for hackathon in recent_hackathons %}
2626
{% include 'includes/hackathon_square.html' %}
2727
{% endfor %}
28-
{% include 'includes/link_square.html' with label="See All Hackathons" redirect_url="hackathon:hackathon-list" %}
28+
{% include 'includes/link_square.html' with label="See All Hackathons" redirect_url="hackathon:list-hackathons" %}
2929
</div>
3030
{% endif %}
3131

teams/tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
class TeamsHelpersTestCase(TestCase):
1818
def setUp(self):
1919
call_command('loaddata', 'organisation', verbosity=0)
20+
call_command('loaddata', 'statuses', verbosity=0)
2021
call_command('loaddata', 'accounts', verbosity=0)
2122
call_command('loaddata', 'resources', verbosity=0)
22-
call_command('loaddata', 'profiles', verbosity=0)
2323
call_command('loaddata', 'emailaddresses', verbosity=0)
2424
call_command('loaddata', 'hackathons', verbosity=0)
2525

@@ -136,9 +136,9 @@ def test_create_teams_in_view(self):
136136
class TeamsViewsTestCase(TestCase):
137137
def setUp(self):
138138
call_command('loaddata', 'organisation', verbosity=0)
139+
call_command('loaddata', 'statuses', verbosity=0)
139140
call_command('loaddata', 'accounts', verbosity=0)
140141
call_command('loaddata', 'resources', verbosity=0)
141-
call_command('loaddata', 'profiles', verbosity=0)
142142
call_command('loaddata', 'emailaddresses', verbosity=0)
143143
call_command('loaddata', 'hackathons', verbosity=0)
144144

templates/faq.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ <h3 class="mt-5">
6969
</p>
7070
<p>
7171
You can do that either from the start page, the
72-
<a href="{% url 'hackathon:hackathon-list' %}">View Hackathons</a> page
72+
<a href="{% url 'hackathon:list-hackathons' %}">View Hackathons</a> page
7373
or (if you have a direct link) from the detail view of the hackathon directly;
7474
simply click on the <strong>"Enroll as participant"</strong> button when
7575
the registration is open.
@@ -80,7 +80,7 @@ <h3 class="mt-5">
8080
<p>
8181
<ol>
8282
<li>
83-
Log in and go to the <a href="{% url 'hackathon:hackathon-list' %}">View Hackathons</a> page
83+
Log in and go to the <a href="{% url 'hackathon:list-hackathons' %}">View Hackathons</a> page
8484
</li>
8585
<li>
8686
Find the hackathon you want to check if you are registered to

templates/includes/navbar.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
<div class="dropdown-menu" aria-labelledby="navbarHackathons">
2626
<!-- TODO: Separate between different admin users -->
2727
<a class="dropdown-item" href="{% url 'hackathon:create_hackathon' %}">Create Hackathon</a>
28-
<a class="dropdown-item" href="{% url 'hackathon:hackathon-list' %}">View Hackathons</a>
28+
<a class="dropdown-item" href="{% url 'hackathon:list-hackathons' %}">View Hackathons</a>
2929
</div>
3030
</li>
3131
{% else %}
3232
<li class="nav-item">
33-
<a class="nav-link" href="{% url 'hackathon:hackathon-list' %}">Hackathons</a>
33+
<a class="nav-link" href="{% url 'hackathon:list-hackathons' %}">Hackathons</a>
3434
</li>
3535
{% endif %}
3636
{% if user.is_authenticated %}

0 commit comments

Comments
 (0)