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