Changeset 1f4ee0b


Ignore:
Timestamp:
Nov 16, 2012, 5:02:22 AM (13 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, space-access, stable, stage
Children:
6e247d3
Parents:
4d79976
git-author:
Alex Dehnert <adehnert@…> (11/16/12 05:02:06)
git-committer:
Alex Dehnert <adehnert@…> (11/16/12 05:02:22)
Message:

Use request.build_absolute_uri

It turns out there's a built-in function to build a full URI that doesn't
involve assembling it by hand.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/views.py

    r4d79976 r1f4ee0b  
    191191            request_obj = form.save()
    192192
    193             view_path = reverse('fysm-view', args=[year, request_obj.pk, ])
    194             view_uri = '%s://%s%s' % (request.is_secure() and 'https' or 'http',
    195                  request.get_host(), view_path)
     193            view_uri = request.build_absolute_uri(reverse('fysm-view', args=[year, request_obj.pk, ]))
    196194
    197195            # Send email
     
    298296        update_obj = None
    299297
    300     confirm_path = reverse('membership-confirm', )
    301     confirm_uri = '%s://%s%s' % (request.is_secure() and 'https' or 'http',
    302          request.get_host(), confirm_path)
     298    confirm_uri = request.build_absolute_uri(reverse('membership-confirm'))
    303299
    304300    if request.method == 'POST':
Note: See TracChangeset for help on using the changeset viewer.