T-618 require release checksum metadata in admin
This commit is contained in:
@@ -1,10 +1,23 @@
|
||||
from django import forms
|
||||
from django.contrib import admin
|
||||
|
||||
from .models import DownloadRelease, ImportTemplate
|
||||
|
||||
|
||||
class DownloadReleaseAdminForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = DownloadRelease
|
||||
fields = "__all__"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.fields["sha256"].required = True
|
||||
self.fields["size_bytes"].required = True
|
||||
|
||||
|
||||
@admin.register(DownloadRelease)
|
||||
class DownloadReleaseAdmin(admin.ModelAdmin):
|
||||
form = DownloadReleaseAdminForm
|
||||
list_display = (
|
||||
"platform",
|
||||
"version",
|
||||
|
||||
Reference in New Issue
Block a user