Skip to content

Commit

Permalink
Added verbose names
Browse files Browse the repository at this point in the history
  • Loading branch information
clr-li committed Oct 31, 2023
1 parent 669e933 commit 2ab62c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
24 changes: 4 additions & 20 deletions app_users/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
class AppUserAdmin(admin.ModelAdmin):
list_display = [
"uid",
"name",
"display_name",
"email",
"phone_number",
"bal",
"paid",
"created",
"balance",
"is_paying",
"created_at",
]
search_fields = [
"uid",
Expand Down Expand Up @@ -51,22 +51,6 @@ def user_runs(self, user: models.AppUser):
show_add=False,
)

@admin.display(description="Name")
def name(self, user: models.AppUser):
return user.display_name

@admin.display(description="Paid")
def paid(self, user: models.AppUser):
return user.is_paying

@admin.display(description="Bal")
def bal(self, user: models.AppUser):
return user.balance

@admin.display(description="Created")
def created(self, user: models.AppUser):
return user.created_at

def open_in_firebase(self, user: models.AppUser):
path = f"users/{user.uid}"
return open_in_new_tab(
Expand Down
10 changes: 6 additions & 4 deletions app_users/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,20 @@ def get_or_create_firebase_user_by_email(email: str) -> tuple[auth.UserRecord, b
class AppUser(models.Model):
uid = models.CharField(max_length=255, unique=True)

display_name = models.TextField(default="", blank=True)
display_name = models.TextField("name", blank=True)
email = models.EmailField(null=True, blank=True)
phone_number = PhoneNumberField(null=True, blank=True)
balance = models.IntegerField()
balance = models.IntegerField("bal")
is_anonymous = models.BooleanField()
is_disabled = models.BooleanField(default=False)
photo_url = CustomURLField(default="", blank=True)

stripe_customer_id = models.CharField(max_length=255, default="", blank=True)
is_paying = models.BooleanField(default=False)
is_paying = models.BooleanField("paid", default=False)

created_at = models.DateTimeField(editable=False, blank=True, default=timezone.now)
created_at = models.DateTimeField(
"created", editable=False, blank=True, default=timezone.now
)
upgraded_from_anonymous_at = models.DateTimeField(null=True, blank=True)

disable_safety_checker = models.BooleanField(default=False)
Expand Down

0 comments on commit 2ab62c1

Please sign in to comment.