def new(request, id): try: pre_member = PreMember.objects.get(id=id) except PreMember.DoesNotExist: raise Http404 try: u = Member(username=pre_member.netid, uin=pre_member.uin) u.save() u.set_unusable_password() member_group = Group.objects.get(name='Member') u.groups.add(member_group) u.save() messages.add_message(request, messages.SUCCESS, 'Member created') pre_member.delete() welcome_msg = """Hello %s %s, You sent a payment of $40.00 USD to the Association for Computing Machinery at the University of Illinois at Urbana-Champaign on %s. ---------------------------------------- ACM@UIUC Lifetime Membership $40.00 USD Subtotal: $40.00 USD Total: $40.00 USD Payment: $40.00 ---------------------------------------- ACM@UIUC Resume Book ==================== We maintain relationships with many corporate partners who are looking for students to fill intern and full-time positions! Consider adding your resume to the ACM Resume Book at http://www.acm.illinois.edu/corporate/resume/! ACM@UIUC Network ================ Your ACM@UIUC Network account and other ACM@UIUC services will be provisioned within 48 hours. You will receive an additional e-mail when this is complete. Questions? Contact [email protected] Please retain this email for your records. Thanks, ACM@UIUC Approved by: %s""" % (u.first_name, u.last_name, u.date_joined.strftime("%a %b %d, %Y %H:%M:%S"), request.user.username) send_mail('Welcome to ACM@UIUC', welcome_msg, '"ACM@UIUC" <*****@*****.**>', [u.email, '*****@*****.**'], fail_silently=False) return HttpResponseRedirect('/intranet/members/search?q=%s' % u.username) # Redirect after POST except ValueError: messages.add_message(request, messages.ERROR, "Not a valid netid") return HttpResponseRedirect('/intranet/members/')
def new(request,id): try: pre_member = PreMember.objects.get(id=id) except PreMember.DoesNotExist: raise Http404 try: u = Member(username=pre_member.netid,uin=pre_member.uin) u.save() u.set_unusable_password() member_group = Group.objects.get(name='Member') u.groups.add(member_group) u.save() messages.add_message(request, messages.SUCCESS, 'Member created') pre_member.delete() welcome_msg = """Hello %s %s, You sent a payment of $40.00 USD to the Association for Computing Machinery at the University of Illinois at Urbana-Champaign on %s. ---------------------------------------- ACM@UIUC Lifetime Membership $40.00 USD Subtotal: $40.00 USD Total: $40.00 USD Payment: $40.00 ---------------------------------------- ACM@UIUC Resume Book ==================== We maintain relationships with many corporate partners who are looking for students to fill intern and full-time positions! Consider adding your resume to the ACM Resume Book at http://www.acm.illinois.edu/corporate/resume/! ACM@UIUC Network ================ Your ACM@UIUC Network account and other ACM@UIUC services will be provisioned within 48 hours. You will receive an additional e-mail when this is complete. Questions? Contact [email protected] Please retain this email for your records. Thanks, ACM@UIUC Approved by: %s"""%(u.first_name,u.last_name,u.date_joined.strftime("%a %b %d, %Y %H:%M:%S"),request.user.username) send_mail('Welcome to ACM@UIUC', welcome_msg, '"ACM@UIUC" <*****@*****.**>',[u.email,'*****@*****.**'], fail_silently=False) return HttpResponseRedirect('/intranet/members/search?q=%s' % u.username) # Redirect after POST except ValueError: messages.add_message(request, messages.ERROR, "Not a valid netid") return HttpResponseRedirect('/intranet/members/')
def new(request,id): try: pre_member = PreMember.objects.get(id=id) except PreMember.DoesNotExist: raise Http404 try: u = Member(username=pre_member.netid,uin=pre_member.uin) u.save() u.set_unusable_password() member_group = Group.objects.get(name='Member') u.groups.add(member_group) u.save() messages.add_message(request, messages.SUCCESS, 'Member created') pre_member.delete() welcome_msg = """Hello %s %s, You sent a payment of $40.00 USD to the Association for Computing Machinery at the University of Illinois at Urbana-Champaign on %s. ---------------------------------------- ACM Lifetime Membership $40.00 USD Subtotal: $40.00 USD Total: $40.00 USD Payment: $40.00 ---------------------------------------- Questions? Contact [email protected] Please retain this email for your records. Thanks, ACM@UIUC Approved by: %s"""%(u.first_name,u.last_name,u.date_joined.strftime("%a %b %d, %Y %H:%M:%S"),request.user.username) send_mail('Welcome to ACM@UIUC', welcome_msg, 'ACM <*****@*****.**>',[u.email,'*****@*****.**'], fail_silently=False) return HttpResponseRedirect('/intranet/members/search?q=%s' % u.username) # Redirect after POST except ValueError: messages.add_message(request, messages.ERROR, "Not a valid netid") return HttpResponseRedirect('/intranet/members/')
import settings setup_environ(settings), os.system('cd liquid; python manage.py syncdb --noinput;') os.system('cd liquid; python manage.py migrate intranet;') os.system('cd liquid; python manage.py migrate intranet.chroma;') from intranet.models import Member, Group, GroupMember from datetime import datetime netid = raw_input('netid? ') uin = raw_input('uin? ') acct_pass = getpass.getpass("account password? ") # setup mailing lists from utils.django_mailman.models import List t_list = List(name="top4") m_list = List(name="Membership-l") j_list = List(name="Jobs-l") t_list.save() m_list.save() j_list.save() m = Member(username=netid,uin=uin) m.set_password(acct_pass) m.save() g = Group(name='Top4',type='O',date_formed=datetime.now(), mailing_list=t_list) g.save() GroupMember(member=m,group=g,is_chair=True,is_admin=True).save()
os.system('cd liquid; python manage.py syncdb --noinput;') os.system('cd liquid; python manage.py migrate intranet;') os.system('cd liquid; python manage.py migrate intranet.chroma;') from intranet.models import Member, Group, GroupMember from datetime import datetime netid = raw_input('netid? ') uin = raw_input('uin? ') acct_pass = getpass.getpass("account password? ") # setup mailing lists from utils.django_mailman.models import List t_list = List(name="top4") m_list = List(name="Membership-l") j_list = List(name="Jobs-l") t_list.save() m_list.save() j_list.save() m = Member(username=netid, uin=uin) m.set_password(acct_pass) m.save() g = Group(name='Top4', type='O', date_formed=datetime.now(), mailing_list=t_list) g.save() GroupMember(member=m, group=g, is_chair=True, is_admin=True).save()