| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | from django.db import models |
||
| 6 | class Cluster(Group): |
||
| 7 | design = models.CharField(max_length=255) |
||
| 8 | |||
| 9 | |||
| 10 | # Related fields: |
||
| 11 | # - cluster_users (model User.clusters) |
||
| 12 | |||
| 13 | def save(self, *args, **kwargs): |
||
| 14 | """ |
||
| 15 | Clusters are special groups: some params cannot be specified by user. |
||
| 16 | """ |
||
| 17 | self.is_private = False |
||
| 18 | self.is_protected = True |
||
| 19 | self.can_anyone_join = False |
||
| 20 | |||
| 21 | return super().save(*args, **kwargs) |
||
| 22 | |||
| 23 | @property |
||
| 24 | def subgroups_list(self): |
||
| 25 | return self.group_ptr.subgroups_list |
||
| 26 |