Skip to content

Instantly share code, notes, and snippets.

@ddemid
Created February 20, 2015 13:26
Show Gist options
  • Save ddemid/4c123269a542c5865353 to your computer and use it in GitHub Desktop.
Save ddemid/4c123269a542c5865353 to your computer and use it in GitHub Desktop.
# @receiver(post_save, sender=User)
# def create_organization(instance, created, **kwargs):
# if created:
# title = str(instance)
# code = re.sub('[\W_]+', '', title.upper())[:3]
# Organization.objects.create(owner=instance, title=title, code=code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment