Created
February 17, 2018 21:08
-
-
Save omarish/abd07456ffb78bf2d5b4253400277be0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mutations | |
class UserSignup(mutations.Mutation): | |
name = mutations.fields.CharField() | |
email = mutations.fields.CharField() | |
def execute(self): | |
user = User.objects.create([...]) | |
if user.is_referred_through_partner: | |
[...] | |
else: | |
self.send_welcome_notification() | |
def send_welcome_notification(self): | |
if user.is_twitter_signup: | |
self.send_message(through='twitter') | |
else: | |
self.send_message(through='email') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment