Merge branch 'models' into qwann/html/base2
This commit is contained in:
commit
fa7f046928
4 changed files with 8 additions and 11 deletions
|
@ -1,7 +1,6 @@
|
||||||
"""
|
"""
|
||||||
GestionEvenmentiel URL configuration
|
GestionEvenmentiel URL configuration
|
||||||
"""
|
"""
|
||||||
from django.conf import settings
|
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
|
|
|
@ -158,9 +158,7 @@ class Activity(ActivityTemplate):
|
||||||
|
|
||||||
def get_herited(self, attrname):
|
def get_herited(self, attrname):
|
||||||
attr = super(Activity, self).__getattribute__(attrname)
|
attr = super(Activity, self).__getattribute__(attrname)
|
||||||
if (attrname == 'parent'
|
if attrname in {"parent", "staff", "equipment"}:
|
||||||
or attrname == 'staff'
|
|
||||||
or attrname == 'equipment'):
|
|
||||||
raise FieldError(
|
raise FieldError(
|
||||||
_("%(attrname)s n'est pas un champ héritable"),
|
_("%(attrname)s n'est pas un champ héritable"),
|
||||||
params={'attrname': attrname},
|
params={'attrname': attrname},
|
||||||
|
|
|
@ -92,24 +92,24 @@ class ActivityInheritanceTest(TestCase):
|
||||||
self.template_act.place.add(self.loge)
|
self.template_act.place.add(self.loge)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.real_act.get_herited('place').get().name,
|
self.real_act.get_herited('place').get().name,
|
||||||
"Loge 45"
|
self.loge
|
||||||
)
|
)
|
||||||
self.real_act.place.add(self.aqua)
|
self.real_act.place.add(self.aqua)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.real_act.get_herited('place').get().name,
|
self.real_act.get_herited('place').get().name,
|
||||||
"Aquarium"
|
self.aqua
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_inherites_tags(self):
|
def test_inherites_tags(self):
|
||||||
self.template_act.tags.add(self.tag_foo)
|
self.template_act.tags.add(self.tag_foo)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.real_act.get_herited('tags').get().name,
|
self.real_act.get_herited('tags').get().name,
|
||||||
"foo"
|
self.tag_foo
|
||||||
)
|
)
|
||||||
self.real_act.tags.add(self.tag_bar)
|
self.real_act.tags.add(self.tag_bar)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
self.real_act.get_herited('tags').get().name,
|
self.real_act.get_herited('tags').get().name,
|
||||||
"bar"
|
self.tag_bar
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,12 @@ from django.conf import settings
|
||||||
|
|
||||||
class CreateUserForm(UserCreationForm):
|
class CreateUserForm(UserCreationForm):
|
||||||
key = forms.CharField(
|
key = forms.CharField(
|
||||||
label="Clée de sécurité",
|
label="Clef de sécurité",
|
||||||
widget=forms.PasswordInput,
|
widget=forms.PasswordInput,
|
||||||
help_text="Cette clée est fournie par l'administrat-rice-eur "
|
help_text="Cette clef est fournie par l'administrat·rice·eur "
|
||||||
"du site. Pour en obtenir une veuillez la-le contacter."
|
"du site. Pour en obtenir une veuillez la-le contacter."
|
||||||
)
|
)
|
||||||
error_m = {'wrong_key': "La clef fournie est eronnée."}
|
error_m = {'wrong_key': "La clef fournie est erronée."}
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = User
|
model = User
|
||||||
|
|
Loading…
Reference in a new issue