diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..0006875 --- /dev/null +++ b/.flake8 @@ -0,0 +1,17 @@ +[flake8] +max-line-length = 88 +select = C,E,F,W,B,B950 +extend-ignore = + E302, + E203, + E501, + F403, ; Import * used + F405, ; X may be undefined, or defined from * imports +exclude = + .git, + __pycache__, + docs/source/conf.py, + old, + build, + dist, + */migrations/*, diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 66fb4fc..55cccef 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,11 +2,11 @@ name: INNOSOFT eventos Build on: push: - branches: + branches: - main - feature/** pull_request: - branches: + branches: - main env: @@ -30,7 +30,7 @@ jobs: ports: - 3307:3306 options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 - + steps: - uses: actions/checkout@v2 - name: Verify and configure MySQL connection @@ -49,13 +49,13 @@ jobs: pip install codacy-coverage sudo apt-get install chromium-browser chromium-chromedriver - name: Make Migrations and Migrate - run: | + run: | python ./manage.py makemigrations python ./manage.py migrate - name: Run Tests - run: | - coverage run --branch --source=. ./manage.py test --keepdb - coverage xml + run: | + coverage run --branch --source=. ./manage.py test --keepdb + coverage xml - name: Codacy Coverage Reporter uses: codacy/codacy-coverage-reporter-action@v1 with: diff --git a/.gitignore b/.gitignore index 6452221..0e3d85e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,13 +7,13 @@ __pycache__ media /**/migrations/** -# Backup files # -*.bak +# Backup files # +*.bak # Vagrant # /Vagrant/.vagrant -# If you are using PyCharm # +# If you are using PyCharm # # User-specific stuff .idea/**/workspace.xml .idea/**/tasks.xml @@ -49,93 +49,93 @@ out/ # JIRA plugin atlassian-ide-plugin.xml -# Python # -*.py[cod] -*$py.class - -# Distribution / packaging -.Python build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -*.egg-info/ -.installed.cfg -*.egg -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.coverage -.coverage.* -.cache -.pytest_cache/ -nosetests.xml -coverage.xml -*.cover -.hypothesis/ - -# Jupyter Notebook -.ipynb_checkpoints - -# pyenv -.python-version - -# celery -celerybeat-schedule.* - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ - -# Sublime Text # -*.tmlanguage.cache -*.tmPreferences.cache -*.stTheme.cache -*.sublime-workspace -*.sublime-project - -# sftp configuration file -sftp-config.json - -# Package control specific files Package -Control.last-run -Control.ca-list -Control.ca-bundle -Control.system-ca-bundle -GitHub.sublime-settings - -# Visual Studio Code # -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -.vscode/launch.json -!.vscode/extensions.json +# Python # +*.py[cod] +*$py.class + +# Distribution / packaging +.Python build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +.pytest_cache/ +nosetests.xml +coverage.xml +*.cover +.hypothesis/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery +celerybeat-schedule.* + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# Sublime Text # +*.tmlanguage.cache +*.tmPreferences.cache +*.stTheme.cache +*.sublime-workspace +*.sublime-project + +# sftp configuration file +sftp-config.json + +# Package control specific files Package +Control.last-run +Control.ca-list +Control.ca-bundle +Control.system-ca-bundle +GitHub.sublime-settings + +# Visual Studio Code # +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +.vscode/launch.json +!.vscode/extensions.json .history \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fd4f3cc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + types: [python, javascript, html, css] + - repo: https://github.com/psf/black + rev: 22.12.0 + hooks: + - id: black + files: \.(py)$ + exclude: ^migrations/ diff --git a/accounts/apps.py b/accounts/apps.py index 3e3c765..0cb51e6 100644 --- a/accounts/apps.py +++ b/accounts/apps.py @@ -2,5 +2,5 @@ class AccountsConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'accounts' + default_auto_field = "django.db.models.BigAutoField" + name = "accounts" diff --git a/accounts/forms.py b/accounts/forms.py index cff8e60..cd11492 100644 --- a/accounts/forms.py +++ b/accounts/forms.py @@ -5,10 +5,18 @@ from participant.models import Participant + class RegisterForm(UserCreationForm): email = forms.EmailField() class Meta: model = Participant - fields = ['username', 'first_name', 'last_name', 'email', 'password1', 'password2', 'photo'] - + fields = [ + "username", + "first_name", + "last_name", + "email", + "password1", + "password2", + "photo", + ] diff --git a/accounts/templates/register.html b/accounts/templates/register.html index 5d1aea8..0100939 100644 --- a/accounts/templates/register.html +++ b/accounts/templates/register.html @@ -10,7 +10,7 @@ {% block content %}
{{ second.username }}
@@ -21,7 +21,7 @@Tu nombre o contraseña no son correctos. Por favor intentalo de nuevo.