diff --git a/ttadmin/users/admin.py b/ttadmin/users/admin.py index 186f127..3212471 100644 --- a/ttadmin/users/admin.py +++ b/ttadmin/users/admin.py @@ -13,4 +13,5 @@ class PubkeyInline(admin.TabularInline): @admin.register(Townie) class TownieAdmin(admin.ModelAdmin): inlines = [PubkeyInline] - pass + list_display = ('reviewed', 'username', 'email') + ordering = ('reviewed',) diff --git a/ttadmin/users/forms.py b/ttadmin/users/forms.py index 5fd11af..e5ea57b 100644 --- a/ttadmin/users/forms.py +++ b/ttadmin/users/forms.py @@ -22,7 +22,7 @@ def validate_username(username): if len(username) < USERNAME_MIN_LENGTH: raise ValidationError('Username too short.') if not USERNAME_RE.match(username): - raise ValidationError('Username must be all lowercase, start with a letter, and only use the _ special charcter') + raise ValidationError('Username must be all lowercase, start with a letter, and only use the _ special character') duplicate = Townie.objects.filter(username=username).count() if duplicate > 0: raise ValidationError('Username already in use :(') diff --git a/ttadmin/users/views.py b/ttadmin/users/views.py index 49aa79a..4f4b5f4 100644 --- a/ttadmin/users/views.py +++ b/ttadmin/users/views.py @@ -23,6 +23,8 @@ class SignupView(FormView): key_type=form.cleaned_data.pop('pubkey_type')) t = Townie(**form.cleaned_data) + if not getattr(t, 'displayname'): + t.displayname = t.username t.set_unusable_password() t.save() pubkey.townie = t