Skip to content

Commit

Permalink
Merge pull request #394 from jupyter-naas/FlorentLvr-patch-1
Browse files Browse the repository at this point in the history
fix: remove naas from naas_drivers
  • Loading branch information
FlorentLvr authored Jul 2, 2024
2 parents 7eae0ba + f91160a commit d8b46a9
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions naas_drivers/tools/linkedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from datetime import datetime
import secrets
import pydash as _pd
import naas
# import naas
from naas_drivers.tools.emailbuilder import EmailBuilder
from naas_drivers.tools.naas_auth import NaasAuth
import json
Expand Down Expand Up @@ -60,19 +60,19 @@ def email_linkedin_limit(email):
email_content = emailbuilder.generate(display="iframe", **content)
return email_content

@staticmethod
def send_email_renewed_cookies():
email = LinkedIn.get_user_email()
email_content = LinkedIn.email_linkedin_limit(email)
naas.notification.send(
email_to=email, subject=EMAIL_COOKIES, html=email_content
)
# @staticmethod
# def send_email_renewed_cookies():
# email = LinkedIn.get_user_email()
# email_content = LinkedIn.email_linkedin_limit(email)
# naas.notification.send(
# email_to=email, subject=EMAIL_COOKIES, html=email_content
# )

@staticmethod
def manage_api_error(res):
if res.status_code != 200:
if int(res.status_code) == 302:
LinkedIn.send_email_renewed_cookies()
# LinkedIn.send_email_renewed_cookies()
raise requests.TooManyRedirects(res.status_code, res.text)
else:
raise BaseException(res.status_code, res.text)
Expand Down

0 comments on commit d8b46a9

Please sign in to comment.