Extra validation of the uploaded ZIP #73
@ -135,6 +135,7 @@ class VersionAdmin(admin.ModelAdmin):
|
||||
'tagline',
|
||||
'date_created',
|
||||
'date_modified',
|
||||
'date_deleted',
|
||||
'average_score',
|
||||
'download_count',
|
||||
)
|
||||
@ -146,7 +147,7 @@ class VersionAdmin(admin.ModelAdmin):
|
||||
'fields': (
|
||||
'id',
|
||||
'tagline',
|
||||
('date_created', 'date_modified'),
|
||||
('date_created', 'date_modified', 'date_deleted'),
|
||||
'extension',
|
||||
'version',
|
||||
'blender_version_min',
|
||||
|
@ -142,6 +142,7 @@ class Extension(
|
||||
'description',
|
||||
'support',
|
||||
'website',
|
||||
'date_deleted',
|
||||
}
|
||||
TYPES = EXTENSION_TYPE_CHOICES
|
||||
STATUSES = EXTENSION_STATUS_CHOICES
|
||||
@ -189,7 +190,8 @@ class Extension(
|
||||
ordering = ['-average_score', '-date_created', 'name']
|
||||
|
||||
def __str__(self):
|
||||
return f'{self.get_type_display()} "{self.name}"'
|
||||
label_deleted = f'{self.date_deleted and " (DELETED ❌)" or ""}'
|
||||
return f'{self.get_type_display()} "{self.name}"{label_deleted}'
|
||||
|
||||
@property
|
||||
def type_slug(self) -> str:
|
||||
@ -580,7 +582,8 @@ class Version(CreatedModifiedMixin, RatingMixin, TrackChangesMixin, SoftDeleteMi
|
||||
self.tags.add(tag)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'{self.extension} v{self.version}'
|
||||
label_deleted = f'{self.date_deleted and " (DELETED ❌)" or ""}'
|
||||
return f'{self.extension} v{self.version}{label_deleted}'
|
||||
|
||||
def is_listed(self):
|
||||
# To be public, a version must not be deleted, must belong to a public
|
||||
|
@ -47,6 +47,7 @@ class ExtensionTest(TestCase):
|
||||
'name': 'Extension name',
|
||||
'status': 1,
|
||||
'support': 'https://example.com/',
|
||||
'date_deleted': None,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
@ -104,7 +104,8 @@ class File(CreatedModifiedMixin, TrackChangesMixin, SoftDeleteMixin, models.Mode
|
||||
objects = FileManager()
|
||||
|
||||
def __str__(self) -> str:
|
||||
return f'{self.original_name} ({self.get_status_display()})'
|
||||
label_deleted = f'{self.date_deleted and " (DELETED ❌)" or ""}'
|
||||
return f'{self.original_name} ({self.get_status_display()}){label_deleted}'
|
||||
|
||||
@property
|
||||
def has_been_validated(self):
|
||||
|
Loading…
Reference in New Issue
Block a user