| |
---|
| | try: |
---|
| | existing_domains = c.domains |
---|
| | |
---|
| | #WEB List selector → TODO → MOVE to Context Processors |
---|
| | web_host = request.META["HTTP_HOST"].split(":") |
---|
| | if len(web_host) == 2: |
---|
| | try: |
---|
| | web_host = request.META["HTTP_HOST"].split(":")#TODO Django DEV only ! |
---|
| | web_host = web_host[0] |
---|
| | except: |
---|
| | web_host = request.META["HTTP_HOST"] |
---|
| | d = c.get_domain(None,web_host) |
---|
| | all_lists = c.lists #TODO get filtered by Domain ! |
---|
| | domainname= d.email_host |
---|
| | domain_lists = [] |
---|
| | for list in c.lists: |
---|
| | if list.host_name == domainname: |
---|
| | domain_lists.append(list) |
---|
| | |
---|
| | except Exception, e: |
---|
| | return HttpResponse(e) |
---|
| | |
---|
| | return render_to_response(template, {'form': form,'domains':existing_domains,'lists':all_lists}) |
---|
| | return render_to_response(template, {'form': form,'domains':existing_domains,'lists':domain_lists}) |
---|
| | |
---|
| | @login_required |
---|
| | def administration(request, template = 'mailman-django/lists/new.html'): |
---|
| | """ |
---|
| |
---|
| | the_list.delete() |
---|
| | # let the user return to the list index page |
---|
| | try: |
---|
| | lists = c.lists |
---|
| | return render_to_response(template, {'lists': lists}) |
---|
| | return redirect("/lists/") |
---|
| | except Exception, e: |
---|
| | return render_to_response('mailman-django/errors/generic.html', |
---|
| | {'message': "Unexpected error:"+ str(e)}) |
---|
| | |
---|
| |
---|
| | |