- Enable meetings app in INSTALLED_APPS and add URL routing - Switch from PostgreSQL to SQLite for default database configuration - Remove meetings directory from .gitignore - Move API root endpoint from users app to main URL configuration - Remove HIPAA-specific email and compliance settings (EMAIL_ENCRYPTION_KEY, HIPAA_EMAIL_CONFIG, BAA_VERIFICATION) - Add SITE_NAME and ENCRYPTION_KEY environment variables - Regenerate initial user migrations These changes simplify the development setup by using SQLite as the default database and removing complex compliance configurations while enabling the core meetings functionality.
33 lines
1.4 KiB
Python
33 lines
1.4 KiB
Python
from django.contrib import admin
|
|
from .models import AdminWeeklyAvailability, AppointmentRequest
|
|
|
|
@admin.register(AdminWeeklyAvailability)
|
|
class AdminWeeklyAvailabilityAdmin(admin.ModelAdmin):
|
|
list_display = ['available_days_display', 'created_at']
|
|
|
|
def available_days_display(self, obj):
|
|
days_map = dict(AdminWeeklyAvailability.DAYS_OF_WEEK)
|
|
return ', '.join([days_map[day] for day in obj.available_days])
|
|
available_days_display.short_description = 'Available Days'
|
|
|
|
@admin.register(AppointmentRequest)
|
|
class AppointmentRequestAdmin(admin.ModelAdmin):
|
|
list_display = ['full_name', 'email', 'status', 'created_at', 'scheduled_datetime']
|
|
list_filter = ['status', 'created_at']
|
|
search_fields = ['first_name', 'last_name', 'email']
|
|
readonly_fields = ['created_at', 'updated_at']
|
|
actions = ['mark_as_scheduled', 'mark_as_rejected']
|
|
|
|
def mark_as_scheduled(self, request, queryset):
|
|
for appointment in queryset:
|
|
if appointment.status == 'pending_review':
|
|
appointment.status = 'scheduled'
|
|
appointment.save()
|
|
mark_as_scheduled.short_description = "Mark selected as scheduled"
|
|
|
|
def mark_as_rejected(self, request, queryset):
|
|
for appointment in queryset:
|
|
if appointment.status == 'pending_review':
|
|
appointment.status = 'rejected'
|
|
appointment.save()
|
|
mark_as_rejected.short_description = "Mark selected as rejected" |