From: Michael Tremer Date: Thu, 15 Aug 2019 14:38:01 +0000 (+0100) Subject: accounts: Only try parsing dates when we have a value X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f345d70a531f2d8a0ca1e60bafd39d667ed34a1f;p=ipfire.org.git accounts: Only try parsing dates when we have a value Signed-off-by: Michael Tremer --- diff --git a/src/backend/accounts.py b/src/backend/accounts.py index fe65126c..71253a44 100644 --- a/src/backend/accounts.py +++ b/src/backend/accounts.py @@ -336,7 +336,8 @@ class Account(Object): value = self._get_string(key) # Parse the timestamp value and returns a datetime object - return datetime.datetime.strptime(value, "%Y%m%d%H%M%SZ") + if value: + return datetime.datetime.strptime(value, "%Y%m%d%H%M%SZ") def _modify(self, modlist): logging.debug("Modifying %s: %s" % (self.dn, modlist))