datatracker/ietf/status/admin.py
Matthew Holloway e5e6c9bc89
feat: Site status message (#7659)
* Status WIP

* feat: Status

* fix: Status tests

* feat: status redirect

* chore: Status tests

* chore: Status tests

* feat: Status tests

* chore: Status playwright tests

* fix: PR feedback, mostly Vue and copyright dates

* fix: Status model migration tidy up

* chore: Status - one migration

* feat: status on doc/html pages

* chore: Resetting Status migration

* chore: removing unused FieldError

* fix: Update Status test to remove 'by'

* chore: fixing API test to exclude 'status'

* chore: fixing status_page test

* feat: Site Status PR feedback. URL coverage debugging

* Adding ietf.status to Tastypie omitted apps

* feat: Site Status PR feedback

* chore: correct copyright year on newly created files

* chore: repair merge damage

* chore: repair more merge damage

* fix: reconcile the api init refactor with ignoring apps

---------

Co-authored-by: Matthew Holloway <Matthew Holloway>
Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2024-08-07 13:36:21 -05:00

20 lines
579 B
Python

# Copyright The IETF Trust 2024, All Rights Reserved
# -*- coding: utf-8 -*-
from datetime import datetime
from django.contrib import admin
from django.template.defaultfilters import slugify
from .models import Status
class StatusAdmin(admin.ModelAdmin):
list_display = ['title', 'body', 'active', 'date', 'by', 'page']
raw_id_fields = ['by']
def get_changeform_initial_data(self, request):
date = datetime.now()
return {
"slug": slugify(f"{date.year}-{date.month}-{date.day}-"),
}
admin.site.register(Status, StatusAdmin)