djbrown/hbscorez

View on GitHub
src/districts/admin.py

Summary

Maintainability
A
2 hrs
Test Coverage
A
100%
Similar blocks of code found in 2 locations. Consider refactoring.
from django.contrib import admin
Similar blocks of code found in 2 locations. Consider refactoring.
 
Similar blocks of code found in 2 locations. Consider refactoring.
from associations.admin import ASSOCIATION_SEARCH_FIELDS
Similar blocks of code found in 2 locations. Consider refactoring.
from districts.models import District
Similar blocks of code found in 2 locations. Consider refactoring.
 
Similar blocks of code found in 2 locations. Consider refactoring.
DISTRICT_SEARCH_FIELDS = ["name", "bhv_id"] + ["associations__" + field for field in ASSOCIATION_SEARCH_FIELDS]
Similar blocks of code found in 2 locations. Consider refactoring.
 
Similar blocks of code found in 2 locations. Consider refactoring.
 
Similar blocks of code found in 2 locations. Consider refactoring.
@admin.register(District)
Similar blocks of code found in 2 locations. Consider refactoring.
class DistrictAdmin(admin.ModelAdmin):
Similar blocks of code found in 2 locations. Consider refactoring.
search_fields = DISTRICT_SEARCH_FIELDS