switch to using pk for profile creation
This commit is contained in:
parent
1e9c91af50
commit
4c385bafd5
3 changed files with 4 additions and 4 deletions
|
@ -6,5 +6,5 @@ urlpatterns = patterns("symposion.speakers.views",
|
|||
url(r"^create/(\w+)/$", "speaker_create_token", name="speaker_create_token"),
|
||||
url(r"^edit/(?:(?P<pk>\d+)/)?$", "speaker_edit", name="speaker_edit"),
|
||||
url(r"^profile/(?P<pk>\d+)/$", "speaker_profile", name="speaker_profile"),
|
||||
url(r"^staff/create/(\w+)/$", "speaker_create_staff", name="speaker_create_staff"),
|
||||
url(r"^staff/create/(\d+)/$", "speaker_create_staff", name="speaker_create_staff"),
|
||||
)
|
||||
|
|
|
@ -44,8 +44,8 @@ def speaker_create(request):
|
|||
|
||||
|
||||
@login_required
|
||||
def speaker_create_staff(request, username):
|
||||
user = get_object_or_404(User, username=username)
|
||||
def speaker_create_staff(request, pk):
|
||||
user = get_object_or_404(User, pk=pk)
|
||||
if not request.user.is_staff:
|
||||
raise Http404
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
{% if user.speaker_profile %}
|
||||
<a href="{% url speaker_profile user.speaker_profile.pk %}">{{ user.speaker_profile }}</a>
|
||||
{% else %}
|
||||
<a href="{% url speaker_create_staff user.username %}" class="btn btn-mini">create</a>
|
||||
<a href="{% url speaker_create_staff user.pk %}" class="btn btn-mini">create</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
|
|
Loading…
Reference in a new issue