mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
FIX: Fix asset sample data command when run alone
This commit is contained in:
@@ -17,6 +17,7 @@ class Command(BaseCommand):
|
||||
|
||||
random.seed('Some object to see the random number generator')
|
||||
|
||||
self.create_profile()
|
||||
self.create_categories()
|
||||
self.create_statuses()
|
||||
self.create_suppliers()
|
||||
@@ -24,6 +25,13 @@ class Command(BaseCommand):
|
||||
self.create_connectors()
|
||||
self.create_cables()
|
||||
|
||||
# Make sure that there's at least one profile if this command is run standalone
|
||||
def create_profile(self):
|
||||
name = "Fred Johnson"
|
||||
models.Profile.objects.create(username=name.replace(" ", ""), first_name=name.split(" ")[0], last_name=name.split(" ")[-1],
|
||||
email=name.replace(" ", "") + "@example.com",
|
||||
initials="".join([j[0].upper() for j in name.split()]))
|
||||
|
||||
def create_categories(self):
|
||||
categories = ['Case', 'Video', 'General', 'Sound', 'Lighting', 'Rigging']
|
||||
|
||||
|
||||
Reference in New Issue
Block a user