From f7c7d3f702859af4c7b7fd8bb230ff66a9c4a028 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste <bleme@pm.me> Date: Mon, 16 Sep 2019 17:09:52 +0200 Subject: [PATCH] update: fix validators import --- djangoldp/tests/models.py | 10 +++++----- setup.cfg | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/djangoldp/tests/models.py b/djangoldp/tests/models.py index cbc473d1..f70c1319 100644 --- a/djangoldp/tests/models.py +++ b/djangoldp/tests/models.py @@ -1,11 +1,9 @@ +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': self.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'] diff --git a/setup.cfg b/setup.cfg index ab33010f..46e3b962 100644 --- a/setup.cfg +++ b/setup.cfg @@ -20,6 +20,7 @@ install_requires = [options.extras_require] dev = + validators factory_boy>=2.11.0 [semantic_release] -- GitLab