Skip to content
GitLab
Explore
Sign in
Commits on Source (9)
Fix invitations of existing persons with short name
· 4a63e5ad
magicfelix
authored
Nov 21, 2022
4a63e5ad
Update changelog
· 0a6cc292
magicfelix
authored
Nov 21, 2022
0a6cc292
Call save method of Person on invite-based registration
· c2fd16b2
magicfelix
authored
Nov 22, 2022
c2fd16b2
Update changelog
· 6d419143
magicfelix
authored
Feb 05, 2023
6d419143
Mark code-entered invitation accepted after signup
· 3dbe7a99
magicfelix
authored
Nov 25, 2022
3dbe7a99
Add missing claims for phone numbers
· 4c7e11f0
Tom Teichler
authored
Dec 17, 2022
and
magicfelix
committed
Feb 05, 2023
4c7e11f0
Update CHANGELOG
· de62182b
Tom Teichler
authored
Dec 17, 2022
and
magicfelix
committed
Feb 05, 2023
de62182b
Check if person exists in dashboard edit permission check
· 7522ecf1
Hangzhi Yu
authored
Jan 25, 2023
and
magicfelix
committed
Feb 17, 2023
7522ecf1
Bump version to 2.12.3
· 30517bda
Nik | Klampfradler
authored
Mar 07, 2023
30517bda
Hide whitespace changes
Inline
Side-by-side
CHANGELOG.rst
View file @
30517bda
...
...
@@ -6,6 +6,18 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_,
and this project adheres to `Semantic Versioning`_.
`2.12.3` - 2023-03-07
---------------------
Fixed
~~~~~
* The permission check for the dashboard edit page failed when the user had no person assigned.
* OIDC scope "phone" had no claims.
* AlekSIS groups were not synced to Django groups on registration of existing persons
* Invitations for existing short name did not work.
* Invitations for persons without pre-defined e-mail address did not behave correctly
`2.12.2`_ - 2022-12-18
----------------------
...
...
@@ -976,3 +988,4 @@ Fixed
.. _2.12: https://edugit.org/AlekSIS/Official/AlekSIS/-/tags/2.12
.. _2.12.1: https://edugit.org/AlekSIS/Official/AlekSIS/-/tags/2.12.1
.. _2.12.2: https://edugit.org/AlekSIS/Official/AlekSIS/-/tags/2.12.2
.. _2.12.3: https://edugit.org/AlekSIS/Official/AlekSIS/-/tags/2.12.3
aleksis/core/apps.py
View file @
30517bda
...
...
@@ -212,6 +212,10 @@ class CoreConfig(AppConfig):
"
postal_code
"
:
request
.
user
.
person
.
postal_code
,
}
if
"
phone
"
in
scopes
and
has_person
(
request
.
user
):
claims
[
"
mobile_number
"
]
=
request
.
user
.
person
.
mobile_number
claims
[
"
phone_number
"
]
=
request
.
user
.
person
.
phone_number
if
"
groups
"
in
scopes
and
has_person
(
request
.
user
):
claims
[
"
groups
"
]
=
list
(
request
.
user
.
person
.
member_of
.
values_list
(
"
name
"
,
flat
=
True
).
all
()
...
...
aleksis/core/forms.py
View file @
30517bda
...
...
@@ -611,6 +611,7 @@ class AccountRegisterForm(SignupForm, ExtensibleForm):
request
=
kwargs
.
pop
(
"
request
"
,
None
)
super
(
AccountRegisterForm
,
self
).
__init__
(
*
args
,
**
kwargs
)
person
=
None
if
request
.
session
.
get
(
"
account_verified_email
"
):
email
=
request
.
session
[
"
account_verified_email
"
]
...
...
@@ -619,16 +620,27 @@ class AccountRegisterForm(SignupForm, ExtensibleForm):
except
(
Person
.
DoesNotExist
,
Person
.
MultipleObjectsReturned
):
raise
SuspiciousOperation
()
self
.
fields
[
"
email
"
].
disabled
=
True
self
.
fields
[
"
email2
"
].
disabled
=
True
elif
request
.
session
.
get
(
"
invitation_code
"
):
try
:
invitation
=
PersonInvitation
.
objects
.
get
(
key
=
request
.
session
.
get
(
"
invitation_code
"
)
)
except
PersonInvitation
.
DoesNotExist
:
raise
SuspiciousOperation
()
if
person
:
available_fields
=
[
field
.
name
for
field
in
Person
.
_meta
.
get_fields
()]
person
=
invitation
.
person
if
person
:
self
.
instance
=
person
available_fields
=
[
field
.
name
for
field
in
Person
.
_meta
.
get_fields
()]
if
person
.
email
:
self
.
fields
[
"
email
"
].
disabled
=
True
self
.
fields
[
"
email2
"
].
disabled
=
True
self
.
fields
[
"
email2
"
].
initial
=
person
.
email
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
)
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
)
...
...
@@ -639,12 +651,29 @@ class AccountRegisterForm(SignupForm, ExtensibleForm):
for
field
in
Person
.
_meta
.
get_fields
():
if
field
.
name
in
self
.
cleaned_data
:
data
[
field
.
name
]
=
self
.
cleaned_data
[
field
.
name
]
person_qs
=
Person
.
objects
.
filter
(
email
=
data
[
"
email
"
])
if
not
person_qs
.
exists
():
if
get_site_preferences
()[
"
account__auto_create_person
"
]:
Person
.
objects
.
create
(
user
=
user
,
**
data
)
if
self
.
instance
:
person_qs
=
Person
.
objects
.
filter
(
pk
=
self
.
instance
.
pk
)
else
:
person_qs
.
update
(
user
=
user
,
**
data
)
person_qs
=
Person
.
objects
.
filter
(
email
=
data
[
"
email
"
])
if
not
person_qs
.
exists
():
if
get_site_preferences
()[
"
account__auto_create_person
"
]:
Person
.
objects
.
create
(
user
=
user
,
**
data
)
if
person_qs
.
exists
():
person
=
person_qs
.
first
()
for
field
,
value
in
data
.
items
():
setattr
(
person
,
field
,
value
)
person
.
user
=
user
person
.
save
()
invitation_code
=
request
.
session
.
get
(
"
invitation_code
"
)
if
invitation_code
:
from
invitations.views
import
accept_invitation
# noqa
try
:
invitation
=
PersonInvitation
.
objects
.
get
(
key
=
invitation_code
)
except
PersonInvitation
.
DoesNotExist
:
raise
SuspiciousOperation
()
accept_invitation
(
invitation
,
request
,
user
)
self
.
custom_signup
(
request
,
user
)
setup_user_email
(
request
,
user
,
[])
return
user
...
...
aleksis/core/views.py
View file @
30517bda
...
...
@@ -52,7 +52,7 @@ from haystack.inputs import AutoQuery
from
haystack.query
import
SearchQuerySet
from
haystack.utils.loading
import
UnifiedIndex
from
health_check.views
import
MainView
from
invitations.views
import
SendInvite
,
accept_invitation
from
invitations.views
import
SendInvite
from
oauth2_provider.exceptions
import
OAuthToolkitError
from
oauth2_provider.models
import
get_application_model
from
oauth2_provider.views
import
AuthorizationView
...
...
@@ -1001,7 +1001,8 @@ class EditDashboardView(PermissionRequiredMixin, View):
if
(
self
.
default_dashboard
and
not
request
.
user
.
has_perm
(
"
core.edit_default_dashboard_rule
"
)
or
getattr
(
person
,
"
is_dummy
"
,
False
)
or
getattr
(
request
.
user
,
"
person
"
,
True
)
and
getattr
(
request
.
user
.
person
,
"
is_dummy
"
,
False
)
):
raise
PermissionDenied
()
...
...
@@ -1105,12 +1106,7 @@ class EnterInvitationCode(FormView):
and
not
PersonInvitation
.
objects
.
get
(
key
=
code
).
accepted
and
not
PersonInvitation
.
objects
.
get
(
key
=
code
).
key_expired
()
):
invitation
=
PersonInvitation
.
objects
.
get
(
key
=
code
)
# Mark invitation as accepted and redirect to signup
accept_invitation
(
invitation
=
invitation
,
request
=
self
.
request
,
signal_sender
=
self
.
request
.
user
)
self
.
request
.
session
[
"
invitation_code_entered
"
]
=
True
self
.
request
.
session
[
"
invitation_code
"
]
=
code
return
redirect
(
"
account_signup
"
)
return
redirect
(
"
invitations:accept-invite
"
,
code
)
...
...
@@ -1435,7 +1431,7 @@ class AccountRegisterView(SignupView):
if
(
not
request
.
user
.
has_perm
(
"
core.can_register
"
)
and
not
request
.
session
.
get
(
"
account_verified_email
"
)
and
not
request
.
session
.
get
(
"
invitation_code
_entered
"
)
and
not
request
.
session
.
get
(
"
invitation_code
"
)
):
raise
PermissionDenied
()
return
super
(
AccountRegisterView
,
self
).
dispatch
(
request
,
*
args
,
**
kwargs
)
...
...
docs/conf.py
View file @
30517bda
...
...
@@ -31,7 +31,7 @@ author = "The AlekSIS Team"
# The short X.Y version
version
=
"
2.12
"
# The full version, including alpha/beta/rc tags
release
=
"
2.12.
2
"
release
=
"
2.12.
3
"
# -- General configuration ---------------------------------------------------
...
...
pyproject.toml
View file @
30517bda
[tool.poetry]
name
=
"AlekSIS-Core"
version
=
"2.12.
2
"
version
=
"2.12.
3
"
packages
=
[
{
include
=
"aleksis"
}
]
...
...