mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 14:52:15 +00:00
Add a "Managed" type which will not be requestable
This commit is contained in:
@@ -2,11 +2,13 @@
|
||||
GROUP_TYPE_BUILTIN = 0
|
||||
GROUP_TYPE_PERMISSION = 1
|
||||
GROUP_TYPE_CORPORATE = 2
|
||||
GROUP_TYPE_MANAGED = 3
|
||||
|
||||
GROUP_TYPE_CHOICES = (
|
||||
(GROUP_TYPE_BUILTIN, 'Built-In'),
|
||||
(GROUP_TYPE_PERMISSION, 'Permission'),
|
||||
(GROUP_TYPE_CORPORATE, 'Corporate'),
|
||||
(GROUP_TYPE_MANAGED, 'Managed'),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -16,6 +16,11 @@ class GroupInformation(models.Model):
|
||||
|
||||
description = models.TextField()
|
||||
|
||||
def save(self):
|
||||
if self.group and (self.group.eveplayercorporation_set.count() or self.group.eveplayeralliance_set.count()):
|
||||
self.type = GROUP_TYPE_MANAGED
|
||||
models.Model.save(self)
|
||||
|
||||
@staticmethod
|
||||
def create_group(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
|
||||
Reference in New Issue
Block a user