Add blankable fields

This commit is contained in:
Basraah 2016-12-04 23:41:26 +10:00
parent bf345361b2
commit ed461d9e7a
2 changed files with 4 additions and 4 deletions

View File

@ -82,9 +82,9 @@ class Migration(migrations.Migration):
('internal', models.BooleanField(default=True, help_text='Internal group, users cannot see, join or request to join this group.<br>Used for groups such as Members, Corp_*, Alliance_* etc.<br><b>Overrides Hidden and Open options when selected.</b>')), ('internal', models.BooleanField(default=True, help_text='Internal group, users cannot see, join or request to join this group.<br>Used for groups such as Members, Corp_*, Alliance_* etc.<br><b>Overrides Hidden and Open options when selected.</b>')),
('hidden', models.BooleanField(default=True, help_text='Group is hidden from users but can still join with the correct link.')), ('hidden', models.BooleanField(default=True, help_text='Group is hidden from users but can still join with the correct link.')),
('open', models.BooleanField(default=False, help_text='Group is open and users will be automatically added upon request. <br>If the group is not open users will need their request manually approved.')), ('open', models.BooleanField(default=False, help_text='Group is open and users will be automatically added upon request. <br>If the group is not open users will need their request manually approved.')),
('description', models.CharField(max_length=512, help_text='Description of the group shown to users.', )), ('description', models.CharField(max_length=512, blank=True, help_text='Description of the group shown to users.', )),
('group_leaders', models.ManyToManyField(related_name='leads_groups', to=settings.AUTH_USER_MODEL, help_text='Group leaders can process group requests for this group specifically. Use the auth.group_management permission to allow a user to manage all groups.',)), ('group_leaders', models.ManyToManyField(related_name='leads_groups', to=settings.AUTH_USER_MODEL, blank=True, help_text='Group leaders can process group requests for this group specifically. Use the auth.group_management permission to allow a user to manage all groups.',)),
], ],
), ),
migrations.RunPython(combine_group_models, reverse_group_models), migrations.RunPython(combine_group_models, reverse_group_models),

View File

@ -50,12 +50,12 @@ class AuthGroup(models.Model):
help_text="Group is open and users will be automatically added upon request. <br>" help_text="Group is open and users will be automatically added upon request. <br>"
"If the group is not open users will need their request manually approved.") "If the group is not open users will need their request manually approved.")
# Group leaders have management access to this group # Group leaders have management access to this group
group_leaders = models.ManyToManyField(User, related_name='leads_groups', group_leaders = models.ManyToManyField(User, related_name='leads_groups', blank=True,
help_text="Group leaders can process group requests for this group " help_text="Group leaders can process group requests for this group "
"specifically. Use the auth.group_management permission to allow " "specifically. Use the auth.group_management permission to allow "
"a user to manage all groups.") "a user to manage all groups.")
description = models.CharField(max_length=512, help_text="Description of the group shown to users.") description = models.CharField(max_length=512, blank=True, help_text="Description of the group shown to users.")
def __str__(self): def __str__(self):
return self.group.name return self.group.name