ae5c1f1848
Ship cash-register registry, section-based portal access, configurable dislocation columns, and trial-hire intern accounts with credentials PDF.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
from django.contrib import admin
|
|
from unfold.admin import ModelAdmin
|
|
|
|
from apps.hiring.models import HiringRequest, InternAccount
|
|
|
|
|
|
@admin.register(InternAccount)
|
|
class InternAccountAdmin(ModelAdmin):
|
|
list_display = ['label', 'username', 'is_active', 'assigned_to', 'updated_at']
|
|
list_filter = ['is_active']
|
|
search_fields = ['label', 'username']
|
|
list_select_related = ['assigned_to']
|
|
ordering = ['label']
|
|
readonly_fields = ['assigned_to', 'created_at', 'updated_at', 'uuid']
|
|
|
|
|
|
@admin.register(HiringRequest)
|
|
class HiringRequestAdmin(ModelAdmin):
|
|
list_display = [
|
|
'last_name', 'first_name', 'status', 'hire_date', 'trial_days',
|
|
'requested_by', 'granted_ticket', 'created_at',
|
|
]
|
|
list_filter = ['status', 'user_location_type']
|
|
search_fields = ['last_name', 'first_name', 'middle_name', 'candidate_email']
|
|
list_select_related = [
|
|
'requested_by', 'decision_by', 'employee', 'post', 'department',
|
|
'user_pharmacy', 'user_location', 'granted_ticket',
|
|
]
|
|
filter_horizontal = ['requested_access']
|
|
ordering = ['-created_at']
|
|
readonly_fields = ['issued_password', 'created_at', 'updated_at', 'uuid']
|