Jira-13 sonar fixes

This commit is contained in:
jain
2023-06-27 11:44:00 +05:30
parent 9bd31f9e86
commit 44b25dde3e
19 changed files with 188 additions and 89 deletions

View File

@ -1,10 +1,12 @@
"""Account admin"""
from django.contrib import admin
# Register your models here.
"""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):
@ -12,14 +14,18 @@ class UserProfileAdmin(admin.ModelAdmin):
@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