Skip to content

Instantly share code, notes, and snippets.

View reg3x's full-sized avatar

Diego Aguilera reg3x

  • Freelancer
  • GMT -0400
View GitHub Profile
@reg3x
reg3x / create_worlds.py
Last active May 27, 2020 16:03
[create worlds] method to create worls #skylab
def handle(self, *args, **options):
company = Company.objects.filter(title="Skylabapps").first()
if company:
Planet.objects.get_or_create(company=company)
Planet.objects.filter(company=company).update(company_name="Skylabapps")
for userenv in UserEnv.objects.all():
with transaction.atomic():
planet = Planet.objects.filter(company=userenv.company).first()
if planet:
try: