This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into featureRequest/apps.problems
- Loading branch information
Showing
11 changed files
with
205 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
exclude_patterns: | ||
- "config/" | ||
- "db/" | ||
- "dist/" | ||
- "features/" | ||
- "**/node_modules/" | ||
- "script/" | ||
- "**/spec/" | ||
- "**/test/" | ||
- "**/tests/" | ||
- "Tests/" | ||
- "**/vendor/" | ||
- "**/*_test.go" | ||
- "**/*.d.ts" | ||
- "**/tests.py" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Upload data to integrations | ||
|
||
on: | ||
push: | ||
pull_request: | ||
types: | ||
- reopened | ||
|
||
jobs: | ||
upload: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: ["3.11"] | ||
poetry-version: ["1.6.1"] | ||
|
||
env: | ||
DATABASE_URL: "sqlite:///db.sqlite3" | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install Poetry ${{ matrix.poetry-version }} | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: ${{ matrix.poetry-version }} | ||
virtualenvs-create: false | ||
installer-parallel: true | ||
|
||
- name: Install dependencies | ||
run: | | ||
poetry run pip install --no-deps --upgrade pip | ||
poetry install --with dev | ||
- name: Generate configuration file | ||
run: ./bin/create-env | ||
|
||
- name: Generate tests coverage report | ||
run: | | ||
poetry run coverage run \ | ||
--source="." manage.py test \ | ||
--settings=server.settings.development | ||
poetry run coverage xml | ||
- name: Upload tests coverage report (Codecov) | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: ./coverage.xml | ||
|
||
- name: Upload tests coverage report (Code Climate) | ||
uses: paambaati/[email protected] | ||
with: | ||
coverageCommand: coverage report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
from django.contrib.auth.forms import UserCreationForm | ||
|
||
from apps.users.models import User | ||
|
||
if TYPE_CHECKING: | ||
BaseUserCreationForm = UserCreationForm[User] | ||
else: | ||
BaseUserCreationForm = UserCreationForm | ||
|
||
|
||
class CreateUserForm(BaseUserCreationForm): | ||
class Meta: | ||
model = User | ||
fields = ["username", "email", "password1", "password2"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.urls import path | ||
|
||
from apps.users.views import RegisterView | ||
|
||
app_name = "users" | ||
|
||
urlpatterns = [ | ||
path("", RegisterView.as_view(), name="register"), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.http import HttpRequest, HttpResponse | ||
from django.shortcuts import redirect, render | ||
from django.views import View | ||
|
||
from apps.users.forms import CreateUserForm | ||
|
||
|
||
class RegisterView(View): | ||
template_name = "registration/register.html" | ||
|
||
def get(self, request: HttpRequest) -> HttpResponse: | ||
form = CreateUserForm() | ||
return render(request, self.template_name, {"form": form}) | ||
|
||
def post(self, request: HttpRequest) -> HttpResponse: | ||
form = CreateUserForm(self.request.POST) | ||
if form.is_valid(): | ||
form.save() | ||
return redirect("login") | ||
|
||
return render(request, self.template_name, {"form": form}) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters