Send email to the authenticated user's email address
This is better than hardcoding in my address. Signed-off-by: Anna Schumaker <Anna@OcarinaProject.net>
This commit is contained in:
parent
bbe14fa88d
commit
ea0eeeb46c
|
@ -11,6 +11,7 @@ os.chdir(os.path.dirname(path))
|
||||||
from . import api
|
from . import api
|
||||||
from . import auth
|
from . import auth
|
||||||
from . import channels
|
from . import channels
|
||||||
|
from . import users
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -25,7 +26,11 @@ __auth = auth.test()
|
||||||
if __auth == None:
|
if __auth == None:
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
__TEAM = __auth["team"]
|
__TEAM = __auth["team"]
|
||||||
|
__USER = users.info(__auth["user_id"])
|
||||||
|
|
||||||
|
|
||||||
def team():
|
def team():
|
||||||
return __TEAM
|
return __TEAM
|
||||||
|
|
||||||
|
def user():
|
||||||
|
return __USER
|
||||||
|
|
|
@ -12,12 +12,16 @@ class User:
|
||||||
self.__user = json.get("name", "")
|
self.__user = json.get("name", "")
|
||||||
self.__first = json["profile"].get("first_name", "")
|
self.__first = json["profile"].get("first_name", "")
|
||||||
self.__last = json["profile"].get("last_name", "")
|
self.__last = json["profile"].get("last_name", "")
|
||||||
|
self.__email = json["profile"].get("email", "")
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
if self.__first == "" and self.__last == "":
|
if self.__first == "" and self.__last == "":
|
||||||
return self.__user
|
return self.__user
|
||||||
return ("%s %s" % (self.__first, self.__last)).strip()
|
return ("%s %s" % (self.__first, self.__last)).strip()
|
||||||
|
|
||||||
|
def email(self):
|
||||||
|
return self.__email
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def info(user):
|
def info(user):
|
||||||
|
|
Loading…
Reference in New Issue