Skip to content

Commit

Permalink
file description updated in the admin panel
Browse files Browse the repository at this point in the history
  • Loading branch information
sheenaze committed Sep 8, 2023
1 parent 287d478 commit 097ae2a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions validator/admin/dataset_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ class DatasetAdmin(ModelAdmin):
list_display = ('id', 'short_name', 'user', 'file')

def file(self, obj):
if len(obj.user_dataset.all()):
if len(obj.user_dataset.all()) and obj.id >= USER_DATASET_MIN_ID:
return obj.user_dataset.all()[0]
elif obj.id< USER_DATASET_MIN_ID:
elif not len(obj.user_dataset.all()) and obj.user is not None:
return "Private admin data"
elif obj.id < USER_DATASET_MIN_ID:
return "Application data"
else:
return "No file assigned"

0 comments on commit 097ae2a

Please sign in to comment.