From c209799bfc54de7316df180ea21c7fa55ffee2b1 Mon Sep 17 00:00:00 2001 From: Sandesh Ghanta Date: Sat, 13 Oct 2018 14:25:16 +0530 Subject: [PATCH 1/3] Hacktober Fest Commit removed if condition in is_valid_mail method. --- server.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/server.py b/server.py index 54cbca9..efb6718 100644 --- a/server.py +++ b/server.py @@ -55,9 +55,7 @@ def is_valid_mail(mailid): except (MySQLdb.Error, MySQLdb.Warning) as e: app.logger.info(e) conn.close() - if (result > 0): - return True - return False + def follow(chatId,new_following): new_following = list(set(new_following)) From a7388965605248828f0b902185c6e24fed5c9b41 Mon Sep 17 00:00:00 2001 From: Aniketh01 Date: Sat, 13 Oct 2018 15:21:16 +0530 Subject: [PATCH 2/3] Update the is_valid_mail function to check if the mails are present in the database --- server.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index efb6718..54cbca9 100644 --- a/server.py +++ b/server.py @@ -55,7 +55,9 @@ def is_valid_mail(mailid): except (MySQLdb.Error, MySQLdb.Warning) as e: app.logger.info(e) conn.close() - + if (result > 0): + return True + return False def follow(chatId,new_following): new_following = list(set(new_following)) From 2d7228a50291bd2601d8c84c4095b99a1fa4ecb1 Mon Sep 17 00:00:00 2001 From: mihirapappu <44111392+mihirapappu@users.noreply.github.com> Date: Sat, 13 Oct 2018 16:30:01 +0530 Subject: [PATCH 3/3] Add files via upload --- a.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 a.py diff --git a/a.py b/a.py new file mode 100644 index 0000000..2d3037d --- /dev/null +++ b/a.py @@ -0,0 +1,10 @@ +import re +def isValidEmail(email): + if len(email) > 7: + if re.match("^.+@([?)[a-zA-Z0-9-.]+.([a-zA-Z]{2,3}|[0-9]{1,3})(]?)$", email) != None: + return True + return False +if isValidEmail("my.email@gmail.com") == True : + print "This is a valid email address" +else: + print "This is not a valid email address"