def application_request_email(application, send_to = "leader"): try: if send_to == "admin": authorised_text = "an administrator" authorised_persons = Person.objects.filter(is_admin = admin) elif send_to == "delegate": authorised_text = "the delegate" authorised_persons = application.institute.delegates.all() else: authorised_text = "the project leader" authorised_persons = application.project.leaders.filter(is_active=True) link, is_secret = base.get_registration_email_link(application) emails.send_request_email(authorised_text, authorised_persons, application, link, is_secret) except: util.log("Exception to send project leader email %s" % traceback.format_exc())
def application_request_email(application, send_to="leader"): try: if send_to == "admin": authorised_text = "an administrator" authorised_persons = Person.objects.filter(is_admin=admin) elif send_to == "delegate": authorised_text = "the delegate" authorised_persons = application.institute.delegates.all() else: authorised_text = "the project leader" authorised_persons = application.project.leaders.filter( is_active=True) link, is_secret = base.get_registration_email_link(application) emails.send_request_email(authorised_text, authorised_persons, application, link, is_secret) except: util.log("Exception to send project leader email %s" % traceback.format_exc())
def aafbootstrap(request): redirect_to = reverse('samlredirect') user, attr = util.findUser(request) if user: return HttpResponseRedirect(redirect_to) ids = util.parseUserId(request, attr) if ids: form = IdForm(ids = ids) if request.method == 'POST': if request.POST.get("Cancel"): return HttpResponseRedirect("/") else: id = request.POST.get('id') new_user, error, person = util.aafbootstrap(request, id) util.log("Create user account username = '******'" % id) if error: return return HttpResponseRedirect(redirect_to) return render_to_response('karaage/common/aafid.html', {'form': form}, context_instance=RequestContext(request)) new_user, error, person = util.aafbootstrap(request) if error: return return HttpResponseRedirect(redirect_to)