Skip to content

Django admin autologin#222

Merged
mlodic merged 2 commits intodevelopfrom
django_auth
Sep 6, 2023
Merged

Django admin autologin#222
mlodic merged 2 commits intodevelopfrom
django_auth

Conversation

@carellamartina
Copy link
Copy Markdown
Collaborator

Description

added automatic login in django admin if the user is an admin

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).

Checklist

  • I have read and understood the rules about how to Contribute to this project.
  • The pull request is for the branch develop.
  • I have added documentation of the new features.
  • Linters (Black, Flake, Isort) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved. All the tests (new and old ones) gave 0 errors.
  • If changes were made to an existing model/serializer/view, the docs were updated and regenerated (check CONTRIBUTE.md).
  • If the GUI has been modified:
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.

Important Rules

  • If you miss to compile the Checklist properly, your PR won't be reviewed by the maintainers.
  • If your changes decrease the overall tests coverage (you will know after the Codecov CI job is done), you should add the required tests to fix the problem
  • Everytime you make changes to the PR and you think the work is done, you should explicitly ask for a review. After being reviewed and received a "change request", you should explicitly ask for a review again once you have made the requested changes.

@mlodic mlodic merged commit 35fe47c into develop Sep 6, 2023
mlodic added a commit that referenced this pull request Sep 6, 2023
* adjusted messages for the registration (#184)

* adjusted messages

* runned prettier

---------

Co-authored-by: Martina Carella <m.carella@external.certego.net>

* added recaptcha on login page  (#185)

* adjusted messages

* runned prettier

* added recaptcha on login page

* adjusted tests

* adjusted docs

---------

Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com>

* updated dependencies

* Bump celery from 5.3.0 to 5.3.1 in /requirements (#192)

Bumps [celery](https://github.com/celery/celery) from 5.3.0 to 5.3.1.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst)
- [Commits](celery/celery@v5.3.0...v5.3.1)

---
updated-dependencies:
- dependency-name: celery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump library/nginx from 1.25.0-alpine to 1.25.1-alpine in /docker (#193)

Bumps library/nginx from 1.25.0-alpine to 1.25.1-alpine.

---
updated-dependencies:
- dependency-name: library/nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump django from 4.1.9 to 4.1.10 in /requirements (#200)

Bumps [django](https://github.com/django/django) from 4.1.9 to 4.1.10.
- [Commits](django/django@4.1.9...4.1.10)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump uwsgi from 2.0.21 to 2.0.22 in /requirements (#217)

Bumps [uwsgi](https://github.com/unbit/uwsgi-docs) from 2.0.21 to 2.0.22.
- [Commits](https://github.com/unbit/uwsgi-docs/commits)

---
updated-dependencies:
- dependency-name: uwsgi
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Matteo Lodi <30625432+mlodic@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump library/nginx from 1.25.1-alpine to 1.25.2-alpine in /docker (#216)

Bumps library/nginx from 1.25.1-alpine to 1.25.2-alpine.

---
updated-dependencies:
- dependency-name: library/nginx
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump certego-saas from 0.6.0 to 0.7.0 in /requirements (#213)

Bumps [certego-saas](https://github.com/certego/certego-saas) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/certego/certego-saas/releases)
- [Commits](certego/certego-saas@0.6.0...0.7.0)

---
updated-dependencies:
- dependency-name: certego-saas
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* tweak

* Bump psycopg2-binary from 2.9.6 to 2.9.7 in /requirements (#212)

Bumps [psycopg2-binary](https://github.com/psycopg/psycopg2) from 2.9.6 to 2.9.7.
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](psycopg/psycopg2@2.9.6...2.9.7)

---
updated-dependencies:
- dependency-name: psycopg2-binary
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* updated read the docs

* Moved

* Squashed '.github/' content from commit 492bd6d

git-subtree-dir: .github
git-subtree-split: 492bd6d16d1620011d5ed428d5325538ee83f6ad

* merge

* Bump django from 4.1.10 to 4.1.11 in /requirements (#219)

Bumps [django](https://github.com/django/django) from 4.1.10 to 4.1.11.
- [Commits](django/django@4.1.10...4.1.11)

---
updated-dependencies:
- dependency-name: django
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump celery from 5.3.1 to 5.3.4 in /requirements (#220)

Bumps [celery](https://github.com/celery/celery) from 5.3.1 to 5.3.4.
- [Release notes](https://github.com/celery/celery/releases)
- [Changelog](https://github.com/celery/celery/blob/main/Changelog.rst)
- [Commits](celery/celery@v5.3.1...v5.3.4)

---
updated-dependencies:
- dependency-name: celery
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Django admin autologin (#222)

* django admin auto login

* bump alpine from 3.14 to 3.18 in dockerfile

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Martina Carella <m.carella@external.certego.net>
Co-authored-by: Daniele Rosetti <d.rosetti@certego.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: 0ssigeno <s.berni@certego.net>
Co-authored-by: Martina Carella <m.carella@certego.net>
@drosetti drosetti deleted the django_auth branch August 19, 2024 12:48
opbot-xd added a commit to opbot-xd/GreedyBear that referenced this pull request Jan 1, 2026
5a78179 Merge pull request GreedyBear-Project#223 from certego/develop
76df2c2 added ruff and fixed a bug (GreedyBear-Project#221)
59bfe83 Explicitly disabled "xpack.security" in Elasticsearch container
0c262e2 Updated CHANGELOG
0599640 Fixed create_python_cache workflow (GreedyBear-Project#222)
4f21023 Added documentation - part 2 (GreedyBear-Project#220)
0d2f931 updated github actions versions (GreedyBear-Project#218)
013f31a Python caching revisited (GreedyBear-Project#217)
548235b Linter requirements reconciliated (GreedyBear-Project#215)
b6fd709 Updated changelog
0cfa137 Ecr (GreedyBear-Project#201)
ed2dd16 Updated codeQL action to v3 (GreedyBear-Project#216)
5f44be8 APT caching revisited (GreedyBear-Project#214)
cf7c16d Updated linters and added changes detection exclusions (GreedyBear-Project#213)
a492676 Deprecation of license check `table-headers` (GreedyBear-Project#212)
0a6db48 Updated python linters also in '_python.yml' workflow

git-subtree-dir: .github
git-subtree-split: 5a78179ab0cbea826c416f8975251b519c2541fc
mlodic pushed a commit that referenced this pull request Jan 3, 2026
* Squashed '.github/' changes from aa1fe1a..5a78179

5a78179 Merge pull request #223 from certego/develop
76df2c2 added ruff and fixed a bug (#221)
59bfe83 Explicitly disabled "xpack.security" in Elasticsearch container
0c262e2 Updated CHANGELOG
0599640 Fixed create_python_cache workflow (#222)
4f21023 Added documentation - part 2 (#220)
0d2f931 updated github actions versions (#218)
013f31a Python caching revisited (#217)
548235b Linter requirements reconciliated (#215)
b6fd709 Updated changelog
0cfa137 Ecr (#201)
ed2dd16 Updated codeQL action to v3 (#216)
5f44be8 APT caching revisited (#214)
cf7c16d Updated linters and added changes detection exclusions (#213)
a492676 Deprecation of license check `table-headers` (#212)
0a6db48 Updated python linters also in '_python.yml' workflow

git-subtree-dir: .github
git-subtree-split: 5a78179ab0cbea826c416f8975251b519c2541fc

* Simplify pre-commit to use only Ruff

- Removed black, isort, flake8, pylint, bandit, autoflake from pre-commit
- Ruff provides equivalent functionality for all of these
- Faster pre-commit execution
- Avoids conflicting linter rules

* Update documentation to reflect Ruff migration

- Replaced black and isort badges with Ruff badge in README
- Updated PR template checklist to mention Ruff instead of Black/Flake/Isort

* Run Ruff to fix linting and formatting issues

- Fixed 37 import sorting and unused import issues
- Reformatted 5 files with ruff format
- Fixed pre-commit ruff args (removed invalid 'check' argument)
- 14 wildcard import warnings remain (F403) which require manual review

* Add .ruff_cache to .gitignore

- Exclude Ruff's cache directory from version control

* Silence F403 wildcard import warnings

As per maintainer feedback, silenced F403 warnings for wildcard imports in __init__.py files since they are acceptable for this project.

* Add pyproject.toml and fix migration file imports

- Created pyproject.toml to extend ruff config for easier CLI usage
- Fixed import sorting in 5 Django migration files
- Now 'ruff check .' works without explicit --config flag

* Apply ruff formatting to remaining files

- Reformatted 30 Python files with ruff format
- This is the result of running 'ruff format .' after creating pyproject.toml
- No logic changes, only formatting (line breaks, spacing)

* Add empty packages.txt for certego/.github v2.0.0 compatibility

The new certego/.github v2.0.0 APT cache workflow requires a packages
file, even if empty. This is a workaround for the workflow's strict
validation that was introduced in v2.0.0.

* Add packages_path to workflow configuration

Pass packages.txt to the workflow to fix APT cache restoration step

* Make packages.txt truly empty

Remove comments that were being interpreted as package names by apt-get

* Specify RabbitMQ version for CI

Use rabbitmq:4-management-alpine to fix Docker image pull error.
The default 'latest' is not a valid tag for management-alpine images.

* Fix RabbitMQ version tag duplication

Use version '4' instead of '4-management-alpine' since the workflow
automatically appends '-management-alpine' suffix

* Expand Ruff rule coverage with comprehensive linting modules

Added comprehensive Ruff rule modules as requested:
- E/W: Full pycodestyle error and warning coverage
- N: pep8-naming for naming conventions
- UP: pyupgrade for modern Python syntax
- B: flake8-bugbear for common Python bugs
- C4: flake8-comprehensions for list/dict improvements
- DJ: flake8-django for Django-specific linting

All rules are documented with inline comments and links to official docs.

Fixed 43 auto-fixable violations (imports, annotations, etc).
Added comprehensive ignore list for intentional code patterns:
- Test helpers (mutable defaults, classmethods)
- ML conventions (X, X_train naming)
- Django patterns (null=True on CharField, models without __str__)
- Legacy naming (viewType, iocType, migration functions)

All checks passing ✅

* Fix easy E/N/UP/C violations as requested

Applied Ruff auto-fixes for straightforward style improvements:
- N804: Renamed 'self' → 'cls' in test classmethods (6 occurrences)
- UP008: Simplified super() calls (3 occurrences)
- UP031/UP032: Modernized string formatting (2 occurrences)
- C401: Fixed set comprehensions (7 occurrences)

Total: 18 violations fixed across 7 files.

Invasive changes (N801/N802 model/function renames, N803/N806 ML naming)
deferred to follow-up issue for dedicated testing and review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants