Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
check_token(token):

            Session = load_token(token)

            Return session.userId

...

Code Block
load_token(token):

...



try:

...



decode token

...



 except base exception:

...



access error

...



find session in database

...



 

...



if session not found:

...



            Input error

...



           

...



Return session

 

Code Block
Communication report


communication_report(error_codes, time_sent):


communication report  = {

...



check error booleans against error codes

...



}

...



for error code in error codes:

...



include readable message

...



return communication report

 

Code Block
Email system


validate_email(email):


if email is in correct format:

...



            return True

...



else:

...



            return False

...



 


send_email(xml, timer_start):


error_codes = []

...



contacts = customerContact(xml)

...



 

...



if xml does not exist or is empty:

...



            append 1 to error_codes

...



 

...



if xml size > 10485760:

...



            append 2 to error_codes

...



 

...



if not validate_email(contacts[‘cust_email’):

...



append 3 to error_codes

...



 

...



if any error codes:

...



            raise Input error

...



create email

...



try:

...



            send mail

...



 

...



return communication_report(error_codes, timer_start) , contacts[‘cust_email’]

...



 

Health check

healthCheckInfo():

...