Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Maják
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TO
Maják
Commits
e6963185
Commit
e6963185
authored
4 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
Tweak users administration for SSO
parent
f126acfa
No related branches found
No related tags found
1 merge request
!1
SSO
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
majak/settings/base.py
+2
-2
2 additions, 2 deletions
majak/settings/base.py
users/forms.py
+13
-8
13 additions, 8 deletions
users/forms.py
users/templates/wagtailusers/users/create.html
+9
-0
9 additions, 0 deletions
users/templates/wagtailusers/users/create.html
with
24 additions
and
10 deletions
majak/settings/base.py
+
2
−
2
View file @
e6963185
...
...
@@ -142,8 +142,8 @@ TAGGIT_CASE_INSENSITIVE = True
AUTH_USER_MODEL
=
"
users.User
"
WAGTAIL_USER_EDIT_FORM
=
"
users.forms.UserEditForm
"
WAGTAIL_USER_CREATION_FORM
=
"
users.forms.UserCreationForm
"
WAGTAIL_USER_EDIT_FORM
=
"
users.forms.
Custom
UserEditForm
"
WAGTAIL_USER_CREATION_FORM
=
"
users.forms.
Custom
UserCreationForm
"
WAGTAIL_PASSWORD_MANAGEMENT_ENABLED
=
False
WAGTAIL_PASSWORD_RESET_ENABLED
=
False
WAGTAILUSERS_PASSWORD_ENABLED
=
False
...
...
This diff is collapsed.
Click to expand it.
users/forms.py
+
13
−
8
View file @
e6963185
from
django
import
forms
from
django.contrib.auth
import
get_user_model
from
wagtail.users.forms
import
UserCreationForm
,
UserEditForm
DISABLED_FIELDS
=
[
"
sso_id
"
,
"
first_name
"
,
"
last_name
"
,
"
email
"
]
class
UserCreationForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
get_user_model
()
class
CustomUserCreationForm
(
UserCreationForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
for
name
in
DISABLED_FIELDS
:
self
.
fields
[
name
].
disabled
=
True
class
UserEditForm
(
forms
.
ModelForm
):
class
Meta
:
model
=
get_user_model
()
class
CustomUserEditForm
(
UserEditForm
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
super
().
__init__
(
*
args
,
**
kwargs
)
for
name
in
DISABLED_FIELDS
:
self
.
fields
[
name
].
disabled
=
True
This diff is collapsed.
Click to expand it.
users/templates/wagtailusers/users/create.html
0 → 100644
+
9
−
0
View file @
e6963185
{% extends "wagtailusers/users/create.html" %}
{% load i18n %}
{% block content %}
{% trans "Add user" as add_user_str %}
{% include "wagtailadmin/shared/header.html" with title=add_user_str icon="user" %}
<p
class=
"nice-padding"
>
Uživatele nelze přidat ručně. Vytvoří se při prvním přihlášení přes Pirátskou identitu.
</p>
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment