Commit f7c7d3f7 authored by Jean-Baptiste's avatar Jean-Baptiste

update: fix validators import

parent 90a25179
Pipeline #5355 passed with stage
in 1 minute and 25 seconds
import validators
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.utils.datetime_safe import date
from django.urls import reverse_lazy
import validators
from django.utils.datetime_safe import date
from djangoldp.models import Model
......@@ -173,6 +171,7 @@ class Circle(Model):
rdf_type = 'hd:circle'
depth = 1
def webid(self):
# hack : We user webid as username for external user (since it's an uniq identifier too)
if validators.url(self.username):
......@@ -181,7 +180,8 @@ def webid(self):
webid = '{0}{1}'.format(settings.BASE_URL, reverse_lazy('user-detail', kwargs={'pk':}))
return webid
get_user_model()._meta.serializer_fields = ['@id', 'username', 'first_name', 'last_name', 'email', 'userprofile',
'conversation_set', 'circle_set']
get_user_model().webid = webid
get_user_model()._meta.anonymous_perms=['view', 'add']
get_user_model()._meta.anonymous_perms = ['view', 'add']
......@@ -20,6 +20,7 @@ install_requires =
dev =
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment