Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
djangoldp
Manage
Activity
Members
Labels
Plan
Issues
99
Issue boards
Milestones
Wiki
Code
Merge requests
5
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
djangoldp-packages
djangoldp
Commits
f7c7d3f7
Commit
f7c7d3f7
authored
5 years ago
by
Jean-Baptiste
Browse files
Options
Downloads
Patches
Plain Diff
update: fix validators import
parent
90a25179
No related branches found
No related tags found
1 merge request
!96
Resolve "Federated Model"
Pipeline
#1162
passed with stage
in 1 minute and 25 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
djangoldp/tests/models.py
+5
-5
5 additions, 5 deletions
djangoldp/tests/models.py
setup.cfg
+1
-0
1 addition, 0 deletions
setup.cfg
with
6 additions
and
5 deletions
djangoldp/tests/models.py
+
5
−
5
View file @
f7c7d3f7
import
validators
from
django.conf
import
settings
from
django.conf
import
settings
from
django.contrib.auth
import
get_user_model
from
django.contrib.auth
import
get_user_model
from
django.db
import
models
from
django.db
import
models
from
django.utils.datetime_safe
import
date
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
from
django.utils.datetime_safe
import
date
import
validators
from
djangoldp.models
import
Model
from
djangoldp.models
import
Model
...
@@ -173,6 +171,7 @@ class Circle(Model):
...
@@ -173,6 +171,7 @@ class Circle(Model):
rdf_type
=
'
hd:circle
'
rdf_type
=
'
hd:circle
'
depth
=
1
depth
=
1
def
webid
(
self
):
def
webid
(
self
):
# hack : We user webid as username for external user (since it's an uniq identifier too)
# hack : We user webid as username for external user (since it's an uniq identifier too)
if
validators
.
url
(
self
.
username
):
if
validators
.
url
(
self
.
username
):
...
@@ -181,7 +180,8 @@ def webid(self):
...
@@ -181,7 +180,8 @@ def webid(self):
webid
=
'
{0}{1}
'
.
format
(
settings
.
BASE_URL
,
reverse_lazy
(
'
user-detail
'
,
kwargs
=
{
'
pk
'
:
self
.
pk
}))
webid
=
'
{0}{1}
'
.
format
(
settings
.
BASE_URL
,
reverse_lazy
(
'
user-detail
'
,
kwargs
=
{
'
pk
'
:
self
.
pk
}))
return
webid
return
webid
get_user_model
().
_meta
.
serializer_fields
=
[
'
@id
'
,
'
username
'
,
'
first_name
'
,
'
last_name
'
,
'
email
'
,
'
userprofile
'
,
get_user_model
().
_meta
.
serializer_fields
=
[
'
@id
'
,
'
username
'
,
'
first_name
'
,
'
last_name
'
,
'
email
'
,
'
userprofile
'
,
'
conversation_set
'
,
'
circle_set
'
]
'
conversation_set
'
,
'
circle_set
'
]
get_user_model
().
webid
=
webid
get_user_model
().
webid
=
webid
get_user_model
().
_meta
.
anonymous_perms
=
[
'
view
'
,
'
add
'
]
get_user_model
().
_meta
.
anonymous_perms
=
[
'
view
'
,
'
add
'
]
This diff is collapsed.
Click to expand it.
setup.cfg
+
1
−
0
View file @
f7c7d3f7
...
@@ -20,6 +20,7 @@ install_requires =
...
@@ -20,6 +20,7 @@ install_requires =
[options.extras_require]
[options.extras_require]
dev
=
dev
=
validators
factory_boy>=2.11.0
factory_boy>=2.11.0
[semantic_release]
[semantic_release]
...
...
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