Skip to content

Commit

Permalink
No more ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Aug 10, 2024
1 parent 3a034f4 commit 4270770
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import evaluation_system.api.plugin_manager as pm
from django.conf import settings
from django.contrib.auth import get_user_model
from evaluation_system.misc import config
from evaluation_system.model.user import User
from rest_framework.permissions import IsAuthenticated
Expand Down Expand Up @@ -159,10 +160,10 @@ def post(self, request):
recipient_names = request.POST["rec"].split(",")

email_adresses = []
ldap_object = get_ldap_object()
for uid in recipient_names:
recipient_info = ldap_object.get_user_info(uid)
email_adresses.append(recipient_info[3])
user = get_user_model().objects.get(username=uid)
if user.email:
email_adresses.append(user.email)

if copy4me == "on":
email_adresses.append(my_email)
Expand Down

0 comments on commit 4270770

Please sign in to comment.