Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Re2o
re2o
Commits
9abd329e
Commit
9abd329e
authored
Jan 24, 2021
by
Jean-Romain Garnier
Committed by
Gabriel Detraz
Jan 24, 2021
Browse files
fix: Indentation and variable name issues in users/models.py
parent
59b948f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
users/models.py
View file @
9abd329e
...
...
@@ -92,8 +92,10 @@ from PIL import Image
from
io
import
BytesIO
import
sys
# General utilities
def
linux_user_check
(
login
):
"""Check if a login comply with unix base login policy
...
...
@@ -913,8 +915,8 @@ class User(
days_not_zero
=
self
.
facture_set
.
filter
(
valid
=
True
).
exclude
(
Q
(
vente__duration_days_membership
=
0
)).
exists
()
if
(
not_zero
or
days_not_zero
\
or
OptionalUser
.
get_cached_value
(
"all_users_active"
)):
self
.
state
=
self
.
STATE_ACTIVE
self
.
save
()
self
.
state
=
self
.
STATE_ACTIVE
self
.
save
()
if
self
.
state
==
self
.
STATE_ARCHIVE
or
self
.
state
==
self
.
STATE_FULL_ARCHIVE
:
self
.
unarchive
()
self
.
state
=
self
.
STATE_ACTIVE
...
...
@@ -1862,6 +1864,7 @@ class User(
"""
return
self
.
theme
.
split
(
"."
)[
0
]
class
Adherent
(
User
):
"""Base re2o Adherent model, inherit from User. Add other attributes.
...
...
@@ -1923,7 +1926,7 @@ class Adherent(User):
:return: An adherent.
"""
return
cls
.
objects
.
get
(
pk
=
adherent
id
)
return
cls
.
objects
.
get
(
pk
=
object_
id
)
@
staticmethod
def
can_create
(
user_request
,
*
_args
,
**
_kwargs
):
...
...
@@ -2790,4 +2793,3 @@ class EMailAddress(RevMixin, AclMixin, models.Model):
if
result
:
raise
ValidationError
(
reason
)
super
(
EMailAddress
,
self
).
clean
(
*
args
,
**
kwargs
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment