From a10fcfa30e8e0ec71b85ca99156aedd10e0ea366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Dlouh=C3=BD?= Date: Mon, 8 Jun 2020 16:26:13 +0200 Subject: [PATCH] use NotImplementedError instead of returning none first_name/last_name --- payments/models.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/payments/models.py b/payments/models.py index 2b7736db2..4e9a9ffdd 100644 --- a/payments/models.py +++ b/payments/models.py @@ -147,29 +147,32 @@ def get_user(self): def get_user_email(self): """ Get user email """ try: + # Most common implementation return self.get_user().email except AttributeError: - return None + raise NotImplementedError() def get_user_first_name(self): """ - Get user first name + Get user first name for purposes of the payment provider Used only by PayU provider for now """ try: + # Most common implementation return self.get_user().first_name except AttributeError: - return None + raise NotImplementedError() def get_user_last_name(self): """ - Get user last name + Get user last name for purposes of the payment provider Used only by PayU provider for now """ try: + # Most common implementation return self.get_user().last_name except AttributeError: - return None + raise NotImplementedError() def get_renew_token(self): """