Skip to content

Commit

Permalink
Appease linter
Browse files Browse the repository at this point in the history
  • Loading branch information
ericswpark committed Jul 10, 2021
1 parent f0e0dc9 commit 436cdf2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def get_codename_from_filename(filename):
# Check field count
if len(fields) != 6:
return None
return fields[2] # Codename
return fields[2] # Codename


@csrf_exempt
Expand Down
6 changes: 6 additions & 0 deletions shipper/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class CustomUserAdmin(UserAdmin):

def get_devices(self, obj):
return [device.codename for device in Device.objects.filter(maintainers=obj)]

get_devices.short_description = 'Devices'


Expand All @@ -22,6 +23,7 @@ class DeviceAdmin(admin.ModelAdmin):

def get_maintainers(self, obj):
return ",".join([maintainer.username for maintainer in obj.maintainers.all()])

get_maintainers.short_description = 'Maintainers'


Expand All @@ -33,6 +35,7 @@ class BuildAdmin(admin.ModelAdmin):

def is_processed(self, obj):
return obj.sha256sum != ''

is_processed.short_description = 'Processed'
is_processed.boolean = True

Expand All @@ -42,16 +45,19 @@ def is_backed_up(self, obj):
return False

return all(mirror in obj.mirrored_on.all() for mirror in list(MirrorServer.objects.filter(enabled=True)))

is_backed_up.short_description = 'Backed Up'
is_backed_up.boolean = True

def get_device_name(self, obj):
return str(obj.device)

get_device_name.short_description = 'Device'
get_device_name.admin_order_field = 'device_name'

def get_build_device_maintainers(self, obj):
return ",".join([maintainer.username for maintainer in obj.device.maintainers.all()])

get_build_device_maintainers.short_description = 'Maintainers'


Expand Down
2 changes: 1 addition & 1 deletion shipper/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_human_readable_size(self):

def test_mirrors(self):
build = Build.objects.get(file_name="Bliss-v14-bullhead-OFFICIAL-gapps-20200608")
self.assertEqual(len(build.get_enabled_downloadable_mirrors()), 0)
self.assertEqual(len(build.get_enabled_downloadable_mirrors()), 0)


class ShipperCombinedTestCase(TestCase):
Expand Down

0 comments on commit 436cdf2

Please sign in to comment.