Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Official
AlekSIS-Core
Commits
4423231f
Commit
4423231f
authored
3 years ago
by
Tom Teichler
Committed by
root
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Create person on signup if unexisting, allow to edit all person fields
parent
5f69250a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!450
User invitations
Pipeline
#45251
canceled
3 years ago
Stage: test
Stage: build
Stage: publish
Stage: docker
Stage: deploy
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/core/forms.py
+36
-6
36 additions, 6 deletions
aleksis/core/forms.py
aleksis/core/preferences.py
+0
-8
0 additions, 8 deletions
aleksis/core/preferences.py
aleksis/core/settings.py
+1
-1
1 addition, 1 deletion
aleksis/core/settings.py
with
37 additions
and
15 deletions
aleksis/core/forms.py
+
36
−
6
View file @
4423231f
...
...
@@ -534,7 +534,23 @@ class AccountRegisterForm(SignupForm, ExtensibleForm):
class
Meta
:
model
=
Person
exclude
=
[
"
guardians
"
,
"
is_active
"
,
"
user
"
,
"
primary_group
"
]
fields
=
[
"
first_name
"
,
"
additional_name
"
,
"
last_name
"
,
"
street
"
,
"
housenumber
"
,
"
postal_code
"
,
"
place
"
,
"
date_of_birth
"
,
"
place_of_birth
"
,
"
sex
"
,
"
photo
"
,
"
mobile_number
"
,
"
phone_number
"
,
"
short_name
"
,
"
description
"
,
]
layout
=
Layout
(
Fieldset
(
...
...
@@ -585,11 +601,25 @@ class AccountRegisterForm(SignupForm, ExtensibleForm):
self
.
fields
[
"
email2
"
].
disabled
=
True
if
person
:
self
.
fields
[
"
first_name
"
].
initial
=
person
.
first_name
self
.
fields
[
"
first_name
"
].
disabled
=
True
self
.
fields
[
"
last_name
"
].
initial
=
person
.
last_name
self
.
fields
[
"
last_name
"
].
disabled
=
True
available_fields
=
[
field
.
name
for
field
in
Person
.
_meta
.
get_fields
()]
for
field
in
self
.
fields
:
if
field
in
available_fields
and
getattr
(
person
,
field
):
self
.
fields
[
field
].
disabled
=
True
self
.
fields
[
field
].
initial
=
getattr
(
person
,
field
)
def
save
(
self
,
request
):
adapter
=
get_adapter
(
request
)
user
=
adapter
.
new_user
(
request
)
adapter
.
save_user
(
request
,
user
,
self
)
# Create person
data
=
self
.
changed_data
if
not
Person
.
objects
.
filter
(
email
=
self
.
cleaned_data
[
"
email
"
]):
_person
=
Person
.
objects
.
create
(
user
=
user
,
**
data
)
_person
.
save
()
self
.
custom_signup
(
request
,
user
)
setup_user_email
(
request
,
user
,
[])
return
user
class
ActionForm
(
forms
.
Form
):
"""
Generic form for executing actions on multiple items of a queryset.
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/preferences.py
+
0
−
8
View file @
4423231f
...
...
@@ -295,14 +295,6 @@ class InviteCodePacketSize(IntegerPreference):
verbose_name
=
_
(
"
Size of packets. (Default 5: abcde)
"
)
@site_preferences_registry.register
class
InviteDayExpiry
(
IntegerPreference
):
section
=
auth
name
=
"
invite_day_expiry
"
default
=
3
verbose_name
=
_
(
"
Expiration time of invitations in days.
"
)
class
OAuthAllowedGrants
(
MultipleChoicePreference
):
"""
Grant Flows allowed for OAuth applications.
"""
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/settings.py
+
1
−
1
View file @
4423231f
...
...
@@ -354,7 +354,7 @@ ACCOUNT_UNIQUE_EMAIL = _settings.get("auth.login.registration.unique_email", Tru
ACCOUNT_ADAPTER
=
"
invitations.models.InvitationsAdapter
"
INVITATIONS_INVITATION_EXPIRY
=
lazy_preference
(
"
auth
"
,
"
invit
e_day_
expiry
"
)
INVITATIONS_INVITATION_EXPIRY
=
_settings
.
get
(
"
auth
.
invit
ation.
expiry
"
,
3
)
INVITATIONS_EMAIL_SUBJECT_PREFIX
=
ACCOUNT_EMAIL_SUBJECT_PREFIX
...
...
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