summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/fixtures/groups_person_types-SRA-fr.json15
-rw-r--r--ishtar_common/models.py5
2 files changed, 16 insertions, 4 deletions
diff --git a/ishtar_common/fixtures/groups_person_types-SRA-fr.json b/ishtar_common/fixtures/groups_person_types-SRA-fr.json
index 9a43072b2..1f60d131f 100644
--- a/ishtar_common/fixtures/groups_person_types-SRA-fr.json
+++ b/ishtar_common/fixtures/groups_person_types-SRA-fr.json
@@ -345,6 +345,17 @@
}
},
{
+ "pk": 8,
+ "model": "ishtar_common.persontype",
+ "fields": {
+ "comment": "",
+ "available": true,
+ "txt_idx": "responsible_planning_service",
+ "groups": [],
+ "label": "Chef de service instructeur"
+ }
+ },
+ {
"pk": 5,
"model": "ishtar_common.persontype",
"fields": {
@@ -374,11 +385,11 @@
"available": true,
"txt_idx": "secretarial_dept",
"groups": [
- 2,
1,
+ 2,
3,
- 7,
6,
+ 7,
8,
9,
10,
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 76ffb761f..611a6089c 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -721,7 +721,8 @@ class Organization(Address, OwnPerms, ValueGetter):
class PersonType(GeneralType):
#rights = models.ManyToManyField(WizardStep, verbose_name=_(u"Rights"))
- groups = models.ManyToManyField(Group, verbose_name=_(u"Groups"))
+ groups = models.ManyToManyField(Group, verbose_name=_(u"Groups"),
+ blank=True, null=True)
class Meta:
verbose_name = _(u"Person type")
verbose_name_plural = _(u"Person types")
@@ -742,7 +743,7 @@ class Person(Address, OwnPerms, ValueGetter) :
name = models.CharField(_(u"Name"), max_length=30)
email = models.CharField(_(u"Email"), max_length=40, blank=True, null=True)
person_types = models.ManyToManyField(PersonType, verbose_name=_(u"Types"))
- attached_to = models.ForeignKey('Organization',
+ attached_to = models.ForeignKey('Organization', related_name='members',
verbose_name=_(u"Is attached to"), blank=True, null=True)
class Meta: