8000 Fem que funcionin els mails genèrics que no son son personals by jaumemoral · Pull Request #206 · UPC/mailtoticket · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Fem que funcionin els mails genèrics que no son son personals #206

Merged
merged 3 commits into from
Oct 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions soa/identitat.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,15 @@ def obtenir_uid_remot(self, mail):
# Pot ser que un usuari d'un departament no tingui a identitat
# digital un mail del tipus @upc.edu, aixi que primer comprovem
# si la part esquerra del mail correspon a un usuari UPC real
# Fent la consulta a identitats en comptes de persones també
# tenim en compte els usuaris genèrics
if "@upc.edu" in mail:
try:
cn = mail.split("@")[0]
persona = requests.get(
self.url+"/externs/persones/"+cn+"/cn",
requests.get(
self.url+"/externs/identitats?cn="+cn,
headers={'TOKEN': self.token}).json()
logger.info("Correspon a un usuari UPC")
return persona['commonName']
return cn
except Exception:
None

Expand Down
0