Skip to content

Commit

Permalink
Fix status code
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikhorluck committed Aug 2, 2024
1 parent e1df4fb commit 89674ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/careeropportunity/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_careeropportunity_index(self):

response = self.client.get(url)

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.status_code, status.HTTP_301_MOVED_PERMANENTLY)

def test_careeropportunity_detail(self):
past = datetime(2000, 1, 1, 1, 0, 0, 0, UTC)
Expand All @@ -29,7 +29,7 @@ def test_careeropportunity_detail(self):

response = self.client.get(url)

self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.status_code, status.HTTP_301_MOVED_PERMANENTLY)


class CompanyAPITestCase(GetUrlMixin, APITestCase):
Expand Down
4 changes: 2 additions & 2 deletions apps/careeropportunity/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

def index(request, id=None):
if id:
return redirect(f"https://online.ntnu.no/career/{id}", True)
return redirect(f"https://online.ntnu.no/career/{id}", permanent=True)
else:
return redirect("https://online.ntnu.no/career", True)
return redirect("https://online.ntnu.no/career", permanent=True)


class HundredItemsPaginator(PageNumberPagination):
Expand Down

0 comments on commit 89674ac

Please sign in to comment.