Skip to content

Instantly share code, notes, and snippets.

@morenoh149
Last active January 11, 2017 17:47
Show Gist options
  • Save morenoh149/5c232a4b72f4a63f7d2957c22f97c1e3 to your computer and use it in GitHub Desktop.
Save morenoh149/5c232a4b72f4a63f7d2957c22f97c1e3 to your computer and use it in GitHub Desktop.
def monitor_model():
try:
user = User().save()
account = Account(user=user).save()
except:
result = 'failed'
else:
result = 'passed'
finally:
if user:
user.delete()
if account:
account.delete()
return django.http.Response(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment