Fix bug with default discourse_username
This commit is contained in:
parent
90b14026d0
commit
8edff64d94
|
@ -32,7 +32,7 @@ class Command(BaseCommand):
|
||||||
'protospace_instructors': [],
|
'protospace_instructors': [],
|
||||||
}
|
}
|
||||||
|
|
||||||
for user in User.objects.filter(member__discourse_username__isnull=False):
|
for user in User.objects.exclude(member__discourse_username__exact=''):
|
||||||
username = user.member.discourse_username
|
username = user.member.discourse_username
|
||||||
|
|
||||||
# handle non-member vs. member
|
# handle non-member vs. member
|
||||||
|
|
|
@ -27,8 +27,8 @@ class Member(models.Model):
|
||||||
last_name = models.CharField(max_length=32)
|
last_name = models.CharField(max_length=32)
|
||||||
preferred_name = models.CharField(max_length=32)
|
preferred_name = models.CharField(max_length=32)
|
||||||
phone = models.CharField(default='', max_length=32, null=True)
|
phone = models.CharField(default='', max_length=32, null=True)
|
||||||
emergency_contact_name = models.CharField(max_length=64, blank=True)
|
emergency_contact_name = models.CharField(default='', max_length=64, blank=True)
|
||||||
emergency_contact_phone = models.CharField(max_length=32, blank=True)
|
emergency_contact_phone = models.CharField(default='', max_length=32, blank=True)
|
||||||
birthdate = models.DateField(blank=True, null=True)
|
birthdate = models.DateField(blank=True, null=True)
|
||||||
is_minor = models.BooleanField(default=False)
|
is_minor = models.BooleanField(default=False)
|
||||||
guardian_name = models.CharField(max_length=32, blank=True, null=True)
|
guardian_name = models.CharField(max_length=32, blank=True, null=True)
|
||||||
|
@ -58,7 +58,7 @@ class Member(models.Model):
|
||||||
paused_date = models.DateField(blank=True, null=True)
|
paused_date = models.DateField(blank=True, null=True)
|
||||||
monthly_fees = models.IntegerField(default=55, blank=True, null=True)
|
monthly_fees = models.IntegerField(default=55, blank=True, null=True)
|
||||||
is_allowed_entry = models.BooleanField(default=True)
|
is_allowed_entry = models.BooleanField(default=True)
|
||||||
discourse_username = models.CharField(default=None, max_length=40, blank=True, null=True)
|
discourse_username = models.CharField(default='', max_length=40, blank=True, null=True)
|
||||||
|
|
||||||
history = HistoricalRecords(excluded_fields=['member_forms'])
|
history = HistoricalRecords(excluded_fields=['member_forms'])
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user