diff --git a/app/models.py b/app/models.py index 7f14d40..f111e06 100644 --- a/app/models.py +++ b/app/models.py @@ -477,8 +477,11 @@ class Domain(db.Model): """ Return domain id """ - domain = Domain.query.filter(Domain.name==name).first() - return domain.id + try: + domain = Domain.query.filter(Domain.name==name).first() + return domain.id + except: + return None def update(self): """