From 7dd20e3084817a520ece177f6fa3fe6377cc9ecd Mon Sep 17 00:00:00 2001
From: Jiri Kalvoda <jirikalvoda@kam.mff.cuni.cz>
Date: Fri, 2 Jul 2021 11:38:28 +0200
Subject: [PATCH] =?UTF-8?q?Db:=20User:=20Funkce=20na=20zji=C5=A1t=C4=9Bn?=
 =?UTF-8?q?=C3=AD=20doposud=20nep=C5=99ihl=C3=A1=C5=A1en=C3=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 mo/db.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/mo/db.py b/mo/db.py
index 429a9302..bb45a9d8 100644
--- a/mo/db.py
+++ b/mo/db.py
@@ -303,6 +303,9 @@ class User(Base):
     def name_sort_key(self) -> Tuple[str, str]:
         return (locale.strxfrm(self.last_name), locale.strxfrm(self.first_name))
 
+    def is_inactive(self) -> bool:
+        return self.password_hash is None
+
 
 class Contest(Base):
     __tablename__ = 'contests'
-- 
GitLab