Commit graph

20 commits

Author SHA1 Message Date
Pēteris Caune
e048ec4c48
Fix "class Foo(object):" -> "class Foo:"
In Python 3 these are equivalent, and shorter is better.
2024-10-29 17:57:50 +02:00
Pēteris Caune
e3cbe79f57
Update CustomHeaderMiddleware to normalize email addresses to lower case
Also add a data migration to normalize any already existing user
accounts with non-lower-case email addresses too.

Fixes: #1074
2024-10-24 13:22:37 +03:00
Pēteris Caune
8a42d2b66b
Add type hints in hc.accounts.middleware 2023-10-26 09:16:18 +03:00
Pēteris Caune
a65aa171f4
Replace var=[...];if var: [...] usages with the walrus operator 2022-12-01 09:16:19 +02:00
Pēteris Caune
161430fb10
Sort imports and add "from __future__ import annotations" 2022-10-17 16:52:15 +03:00
Shea Polansky
54a95a0ee2
Add http header auth (#457)
* Add HTTP header authentiation backend/middleware

* Add docs for remote header auth

* Improve docs on external auth

* Add warning for unknown  REMOTE_USER_HEADER_TYPE

* Move active check for header auth to middleware
Add extra header type sanity check to the backend

* Add test cases for remote header login

* Improve header-based authentication

- remove the 'ID' mode
- add CustomHeaderBackend to AUTHENTICATION_BACKENDS conditionally
- rewrite CustomHeaderBackend and CustomHeaderMiddleware to
use less inherited code
- add more test cases

Co-authored-by: Pēteris Caune <cuu508@gmail.com>
2020-12-09 11:25:56 +02:00
Pēteris Caune
6a0c90853b
request.project is now unused, removing 2020-02-26 10:37:19 +02:00
Pēteris Caune
8dd91b247b
When user has no projects, don't auto-create a project. 2019-01-29 13:19:15 +02:00
Pēteris Caune
eaf49f2367
Don't switch projects when viewing the "Account Settings" page 2019-01-22 16:23:51 +02:00
Pēteris Caune
c42a854e75
Fix project names in the top navigation dropdown menu, avoid duplicates. 2019-01-19 19:08:06 +02:00
Pēteris Caune
e98bd42438
Fix project names in the top navigation dropdown menu. 2019-01-19 18:51:29 +02:00
Pēteris Caune
f357cd3305
Prepare for removing Check.user_id, Channel.user_id, Profile.current_team_id 2019-01-14 21:13:57 +02:00
Pēteris Caune
1c69cf7f89
Project model. cc: #183 2019-01-12 16:40:21 +02:00
Pēteris Caune
ba6995198b Fix tests, lazy-load user's teams. 2018-02-26 12:49:25 +02:00
Pēteris Caune
367f5a595d Small tweaks to make sure we don't query accounts_profile multiple times on every request. 2017-08-30 22:18:31 +03:00
Pēteris Caune
965accaedb REGISTRATION_OPEN setting. superuser accounts by default have team access enabled. Fixes #97 and #113 2017-02-24 15:58:11 +02:00
Pēteris Caune
965e32884b Django 1.10 2016-08-29 17:54:53 +03:00
Pēteris Caune
ee3f49c89b TeamAccessMiddleware: create Profile object if it is missing. This solves problems for users created with "manage.py createsuperuser". Fixes #77 2016-08-29 17:02:24 +03:00
Pēteris Caune
00d18e86bd Reduce query count for team lookups 2016-05-09 16:51:22 +03:00
Pēteris Caune
fdf9c607e5 Team Access, test cleanup 2016-05-09 15:35:13 +03:00