Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. @app.route('/display', methods=["GET", "POST"])
  2. def display():
  3. result = request.form.to_dict()
  4. result['emailAlias'] = result["firstName"].lower() + "." + result["lastName"].lower() + "@email.com"
  5. result['userName'] = result['firstName'][0].lower() + result['lastName'].lower()
  6. result['fullName'] = result['firstName'] + " " + result['lastName']
  7. result['emailAddress'] = result['userName'] + "@email.com"
  8. result['proxyAddress'] = "smtp:" + result['emailAddress']
  9. result['mailingLists'] = []
  10. #it goes on ...
  11. if result['department'] == "Account Management":
  12. result['mailingLists'].append("this_thing@mail.com")
  13. result['adGroups'].append("this_otherthing@mail.com")
  14. elif result['department'] in ['Engineering', 'Dev']:
  15. result['mailingLists'].append("engineering@mail.com")
  16. result['mailingLists'].append("tech@mail.com")
  17. result['otherGroup'].append("developers")
  18. result['otherGroup'] = ["engineering"]
  19. result['adGroups'].append("Knitting")
  20. elif result['department'] == "Food Eating":
  21. result['mailingLists'].append("foodeating@mail.com")
  22. result['adGroups'].append("noteating")
  23. elif result['department'] == "Operations - The Video Game":
  24. result['otherCat'].append("Operations - The Video Game")
  25. result['mailingLists'].append("opGame@mail.com")
  26. elif result['department'] == "Operations - The Movie":
  27. result['otherCat'].append("Operations - The Movie")
  28. result['mailingLists'].append("opMovie@mail.com")
  29. #etc...
  30. return render_template('newpage.html', result=result)
  31.  
  32. @app.route('/display', methods=["GET", "POST"])
  33. def display():
  34. result = request.form.to_dict()
  35. result['emailAlias'] = result["firstName"].lower() + "." + result["lastName"].lower() + "@email.com"
  36. result['userName'] = result['firstName'][0].lower() + result['lastName'].lower()
  37. result['fullName'] = result['firstName'] + " " + result['lastName']
  38. result['emailAddress'] = result['userName'] + "@email.com"
  39. result['proxyAddress'] = "smtp:" + result['emailAddress']
  40. result['mailingLists'] = []
  41. #it goes on ...
  42. if result['department'] == "Account Management":
  43. result['mailingLists'].append("this_thing@mail.com")
  44. result['adGroups'].append("this_otherthing@mail.com")
  45. elif result['department'] in ['Engineering', 'Dev']:
  46. result['mailingLists'].append("engineering@mail.com")
  47. result['mailingLists'].append("tech@mail.com")
  48. result['otherGroup'].append("developers")
  49. result['otherGroup'] = ["engineering"]
  50. result['adGroups'].append("Knitting")
  51. elif result['department'] == "Food Eating":
  52. result['mailingLists'].append("foodeating@mail.com")
  53. result['adGroups'].append("noteating")
  54. elif result['department'] == "Operations - The Video Game":
  55. result['otherCat'].append("Operations - The Video Game")
  56. result['mailingLists'].append("opGame@mail.com")
  57. elif result['department'] == "Operations - The Movie":
  58. result['otherCat'].append("Operations - The Movie")
  59. result['mailingLists'].append("opMovie@mail.com")
  60. #etc...
  61. return render_template('newpage.html', result=result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement