Applying pycodestyle recommendations on admin.py
This commit is contained in:
parent
2ccbd49791
commit
4287c4e40e
1 changed files with 11 additions and 11 deletions
|
@ -1,6 +1,15 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
from django.contrib.auth.models import Group
|
||||||
|
|
||||||
|
from two_factor.models import PhoneDevice
|
||||||
|
from django_otp.plugins import otp_totp, otp_static
|
||||||
|
from django_cron.models import CronJobLog
|
||||||
|
from django_celery_results.models import TaskResult
|
||||||
|
|
||||||
from .models import Organization, Device, Network, Model, Wifi, Notification
|
from .models import Organization, Device, Network, Model, Wifi, Notification
|
||||||
|
|
||||||
|
# Registering own models
|
||||||
|
|
||||||
admin.site.register(Organization)
|
admin.site.register(Organization)
|
||||||
admin.site.register(Device)
|
admin.site.register(Device)
|
||||||
admin.site.register(Network)
|
admin.site.register(Network)
|
||||||
|
@ -8,23 +17,14 @@ admin.site.register(Model)
|
||||||
admin.site.register(Wifi)
|
admin.site.register(Wifi)
|
||||||
admin.site.register(Notification)
|
admin.site.register(Notification)
|
||||||
|
|
||||||
from django.contrib.auth.models import Group
|
# Unregistering unused framework models
|
||||||
|
|
||||||
admin.site.unregister(Group)
|
admin.site.unregister(Group)
|
||||||
|
|
||||||
from two_factor.models import PhoneDevice
|
# Unregistering unused third-party module models
|
||||||
|
|
||||||
admin.site.unregister(PhoneDevice)
|
admin.site.unregister(PhoneDevice)
|
||||||
|
|
||||||
from django_otp.plugins import otp_totp, otp_static
|
|
||||||
|
|
||||||
admin.site.unregister(otp_totp.models.TOTPDevice)
|
admin.site.unregister(otp_totp.models.TOTPDevice)
|
||||||
admin.site.unregister(otp_static.models.StaticDevice)
|
admin.site.unregister(otp_static.models.StaticDevice)
|
||||||
|
|
||||||
from django_cron.models import CronJobLog
|
|
||||||
|
|
||||||
admin.site.unregister(CronJobLog)
|
admin.site.unregister(CronJobLog)
|
||||||
|
|
||||||
from django_celery_results.models import TaskResult
|
|
||||||
|
|
||||||
admin.site.unregister(TaskResult)
|
admin.site.unregister(TaskResult)
|
||||||
|
|
Loading…
Reference in a new issue