Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pirates
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
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
pirates
Commits
9151e93a
Commit
9151e93a
authored
5 years ago
by
jan.bednarik
Browse files
Options
Downloads
Patches
Plain Diff
Fix expected behavior of User model
parent
0fd9f98b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pirates/models.py
+19
-0
19 additions, 0 deletions
pirates/models.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
20 additions
and
1 deletion
pirates/models.py
+
19
−
0
View file @
9151e93a
...
@@ -35,6 +35,9 @@ class AbstractUser(PermissionsMixin):
...
@@ -35,6 +35,9 @@ class AbstractUser(PermissionsMixin):
)
)
date_joined
=
models
.
DateTimeField
(
_
(
"
date joined
"
),
default
=
timezone
.
now
)
date_joined
=
models
.
DateTimeField
(
_
(
"
date joined
"
),
default
=
timezone
.
now
)
USERNAME_FIELD
=
"
sso_id
"
REQUIRED_FIELDS
=
[]
class
Meta
:
class
Meta
:
abstract
=
True
abstract
=
True
verbose_name
=
_
(
"
user
"
)
verbose_name
=
_
(
"
user
"
)
...
@@ -49,6 +52,22 @@ class AbstractUser(PermissionsMixin):
...
@@ -49,6 +52,22 @@ class AbstractUser(PermissionsMixin):
"""
Return the short name for the user.
"""
"""
Return the short name for the user.
"""
return
self
.
first_name
return
self
.
first_name
@property
def
is_anonymous
(
self
):
"""
Always return False. This is a way of comparing User objects to
anonymous users.
"""
return
False
@property
def
is_authenticated
(
self
):
"""
Always return True. This is a way to tell if the user has been
authenticated in templates.
"""
return
True
class
AbstractTeam
(
models
.
Model
):
class
AbstractTeam
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
250
,
unique
=
True
)
name
=
models
.
CharField
(
max_length
=
250
,
unique
=
True
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
9151e93a
...
@@ -13,7 +13,7 @@ def read(fname):
...
@@ -13,7 +13,7 @@ def read(fname):
setup
(
setup
(
name
=
"
pirates
"
,
name
=
"
pirates
"
,
version
=
"
0.
2.1
"
,
version
=
"
0.
3.0
"
,
license
=
"
MIT
"
,
license
=
"
MIT
"
,
description
=
"
Django app for users, teamds and groups.
"
,
description
=
"
Django app for users, teamds and groups.
"
,
long_description
=
read
(
"
README.md
"
),
long_description
=
read
(
"
README.md
"
),
...
...
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