Skip to content

Commit

Permalink
Revert remove barcode from factory
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Oct 28, 2024
1 parent ba59dd0 commit 67392e4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ralph/data_center/tests/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ class DataCenterAssetFactory(DjangoModelFactory):
force_depreciation = False
model = factory.SubFactory(DataCenterAssetModelFactory)
sn = factory.Faker('ssn')
barcode = None # factory.Sequence(lambda n: 'dc' + str(n + 10**8))
barcode = factory.Sequence(lambda n: 'dc' + str(n + 10**8))
hostname = factory.Sequence(lambda n: 'ralph{}.allegro.pl'.format(n))
order_no = factory.Sequence(lambda n: 'Order number ' + str(n))
budget_info = factory.SubFactory(BudgetInfoFactory)
Expand Down
3 changes: 2 additions & 1 deletion src/ralph/virtual/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,10 @@ def parent_(self, obj):
return '<a href="{}">{}</a>'.format(
parent.get_absolute_url(), parent.hostname
)
except: # this happens when no parent or parent doesn't have a hostname
except: # noqa # this happens when no parent or parent doesn't have a hostname
return '-'


class CloudHostTabularInline(RalphTabularInline):
can_delete = False
model = CloudHost
Expand Down

0 comments on commit 67392e4

Please sign in to comment.