Changeset f462be6


Ignore:
Timestamp:
May 22, 2010, 11:17:46 PM (15 years ago)
Author:
Alex Dehnert <adehnert@…>
Branches:
master, fysm-4-1, space-access, stable, stage, test-hooks
Children:
1f94b84
Parents:
e4773d4
git-author:
Alex Dehnert <adehnert@…> (05/22/10 23:17:46)
git-committer:
Alex Dehnert <adehnert@…> (05/22/10 23:17:46)
Message:

Use intermediate page for join links

Location:
asadb
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • asadb/forms/views.py

    rae881e5 rf462be6  
    100100    )
    101101
     102def fysm_link(request, year, link_type, submission, ):
     103    submit_obj = get_object_or_404(forms.models.FYSM, pk=submission,)
     104    if submit_obj.year != int(year):
     105        raise Http404("Year mismatch: fysm.year='%s', request's year='%s'" % (submit_obj.year, year, ))
     106    if link_type == 'join':
     107        url = submit_obj.join_url
     108    elif link_type == 'website':
     109        url = submit_obj.website
     110    else:
     111        raise Http404("Unknown link type")
     112    return HttpResponseRedirect(url)
     113
    102114def select_group_fysm(request, ):
    103115    qobj = Q(activity_category__name='Dorm') | Q(activity_category__name='FSILG')
  • asadb/template/fysm/fysm_listing.html

    re4773d4 rf462be6  
    3232    </div>
    3333    <p class='data'>{{fysm.description}}</p>
    34     <p class='join'><a href='{{fysm.join_url}}'>Join {{fysm.display_name}}!</a> Have questions? Send them to <a href='mailto:{{fysm.contact_email}}'>{{fysm.contact_email}}</a>!</p>
     34    <p class='join'><a href='{% url fysm-link year "join" fysm.pk %}'>Join {{fysm.display_name}}!</a> Have questions? Send them to <a href='mailto:{{fysm.contact_email}}'>{{fysm.contact_email}}</a>!</p>
    3535    </div>
    3636    {% if fysm.tags %}
  • asadb/urls.py

    raaa8e04 rf462be6  
    3030    url(r'^fysm/submit/thanks/(\d+)/$', forms.views.fysm_thanks, name='fysm-thanks', ),
    3131    url(r'^fysm/(\d+)/view/(\d+)/$', forms.views.fysm_view, name='fysm-view', ),
     32    url(r'^fysm/(\d+)/(join|website)/(\d+)/$', forms.views.fysm_link, name='fysm-link', ),
    3233    url(r'^fysm/(?:(\d+)/)?(?:([\w-]+)/)?$', forms.views.fysm_by_years, name='fysm', ),
    3334
Note: See TracChangeset for help on using the changeset viewer.