Skip to content

Commit

Permalink
Move portal code into its own app folder (#295)
Browse files Browse the repository at this point in the history
## Changes

- Moved files into a specific `portal` folder so I can have the
deployment to infra running from another folder.

## Issue(s)

- #
  • Loading branch information
Gustavo-SF authored Jul 19, 2024
1 parent 1369d9f commit 95f9954
Show file tree
Hide file tree
Showing 3,270 changed files with 53 additions and 37 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
build-and-push:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./portal
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/portal-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
jobs:
requirements:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./portal
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -26,6 +29,9 @@ jobs:
ruff:
needs: requirements
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./portal
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down Expand Up @@ -58,6 +64,9 @@ jobs:
black:
needs: requirements
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./portal
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand Down
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# LDSA Portal
# LDSA Portal Management

[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Your friendly neighborhood LDSA Academy portal.

## Documentation

You will find the complete documentation at [Notion](https://marble-van-259.notion.site/DevOps-Documentation-9b98a4d496524d9ea16824febeb0fec9?pvs=4).
This repository contains the Django App that defines the LDSA Portal and it also contains the Helm Chart that deploys the portal to the Kubernetes cluster.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions portal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# LDSA Portal

[![Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)

Your friendly neighborhood LDSA Academy portal.

## Documentation

You will find the complete documentation at [Notion](https://marble-van-259.notion.site/DevOps-Documentation-9b98a4d496524d9ea16824febeb0fec9?pvs=4).
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

env = environ.Env()

READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=False)
READ_DOT_ENV_FILE = env.bool("DJANGO_READ_DOT_ENV_FILE", default=True)
if READ_DOT_ENV_FILE:
# OS environment variables take precedence over variables from .env
env.read_env(str(ROOT_DIR.path(".env")))
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class CandidateState(NamedTuple): # noqa: D101
academy_type: str | None



class DomainExceptionError(Exception): # noqa: D101
pass

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 15 additions & 13 deletions portal/candidate/views.py → portal/portal/candidate/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,21 @@ def post( # noqa: ANN201, D102
user.ticket_type = TicketType.scholarship
user.save()
return redirect("admissions:candidate:home")


class AcademyTypeView(AdmissionsCandidateViewMixin, CandidateAcceptedCoCMixin, TemplateView):
"""Choose academy type preference.""" # noqa: D211
template_name = "candidate_templates/academy_type.html"
def post( # noqa: ANN201, D102
self, request, *args, **kwargs # noqa: ANN001, ANN002, ANN003, ANN101, ARG002
): # noqa: ANN001, ANN002, ANN003, ANN101, ANN201, ARG002, D102
user = request.user
user.academy_type_preference = request.POST["academy_type"]
user.save()
return redirect("admissions:candidate:home")

"""Choose academy type preference.""" # noqa: D211

template_name = "candidate_templates/academy_type.html"

def post( # noqa: ANN201, D102
self, request, *args, **kwargs # noqa: ANN001, ANN002, ANN003, ANN101, ARG002
): # noqa: ANN001, ANN002, ANN003, ANN101, ANN201, ARG002, D102
user = request.user
user.academy_type_preference = request.POST["academy_type"]
user.save()
return redirect("admissions:candidate:home")


class CandidateBeforeCodingTestView(AdmissionsCandidateViewMixin, TemplateView): # noqa: D101
Expand All @@ -215,6 +215,7 @@ def post( # noqa: ANN201, D102

return HttpResponseRedirect(reverse("admissions:candidate:confirmation-coding-test"))


class CandidateConfirmationCodingTestView(AdmissionsCandidateViewMixin, TemplateView): # noqa: D101
template_name = "candidate_templates/confirmation_coding_test.html"

Expand All @@ -237,6 +238,7 @@ def post( # noqa: ANN201, D102

return HttpResponseRedirect(reverse("admissions:candidate:coding-test"))


def submission_view_ctx(application, challenge) -> dict[str, Any]: # noqa: ANN001, D103
return {
"challenge": challenge,
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Loading

0 comments on commit 95f9954

Please sign in to comment.