def group_apply(group):
originalgroup = group
group = str(group)
assert(group in app.config["groups"]["closedgroups"]+app.config["groups"]["opengroups"])
join = True
if group in app.config["groups"]["closedgroups"]:
group = group+"-pending"
join = False
if current_user.accountStatus[0]=="Ineligible":
if group not in app.config["groups"]["publicgroups"]:
flash("You cannot join that group.", "danger")
return redirect("/groups")
ldaptools.modgroup(current_user.get_id() , MOD_ADD, group)
if join:
flash("Joined %s group" % group, "success")
else:
flash("Applied for %s group" % originalgroup, "success")
return redirect("/groups")
评论列表
文章目录