mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-11-27 09:04:54 +00:00
changes
This commit is contained in:
31
account/admin.py
Normal file
31
account/admin.py
Normal file
@ -0,0 +1,31 @@
|
||||
"""Account admin"""
|
||||
from django.contrib import admin
|
||||
|
||||
"""Import django app"""
|
||||
from .models import UserProfile, UserEmailOtp, UserPhoneOtp
|
||||
# Register your models here.
|
||||
@admin.register(UserProfile)
|
||||
class UserProfileAdmin(admin.ModelAdmin):
|
||||
"""User profile admin"""
|
||||
list_display = ['user']
|
||||
|
||||
def __str__(self):
|
||||
return self.user__email
|
||||
|
||||
@admin.register(UserEmailOtp)
|
||||
class UserEmailOtpAdmin(admin.ModelAdmin):
|
||||
"""User Email otp admin"""
|
||||
list_display = ['email']
|
||||
|
||||
def __str__(self):
|
||||
"""Return object in email and otp format"""
|
||||
return self.email + '-' + self.otp
|
||||
|
||||
@admin.register(UserPhoneOtp)
|
||||
class UserPhoneOtpAdmin(admin.ModelAdmin):
|
||||
"""User Phone otp admin"""
|
||||
list_display = ['phone']
|
||||
|
||||
def __str__(self):
|
||||
"""Return object in phone number and otp format"""
|
||||
return self.phone + '-' + self.otp
|
||||
Reference in New Issue
Block a user