union initial group save

master
Mustafa Yontar 4 years ago
parent db5233cf9d
commit 58c5d37a21
  1. 9
      models/Union.py

@ -7,3 +7,12 @@ class Union(Document):
description = StringField()
legal_registration_number = StringField()
headquarter = StringField()
def save(self,*args, **kwargs):
super(Union, self).save(*args, **kwargs)
from .Group import Group
group = Group()
group.union = self
group.name = 'Root'
group.rights = ["*::*::{}}/*".format(self.id)]
group.save()

Loading…
Cancel
Save