Fix up user rfid urls

This commit is contained in:
Oliver Marks 2018-01-15 18:32:19 +00:00
parent 1fb2b65df2
commit 9d50b92f40
4 changed files with 15 additions and 14 deletions

View File

@ -2,6 +2,7 @@ from django.conf.urls import url
from mhackspace.rfid import views
app_name = 'rfid'
access_card_patterns = ([
url(
regex=r'^$',

View File

@ -6,7 +6,7 @@
{% block content %}
{% if form %}
<h1>{{ user.username }}</h1>
<form class="form-horizontal" method="post" action="{% url 'users:access_cards:create' %}" enctype="multipart/form-data">
<form class="form-horizontal" method="post" action="{% url 'users:rfid::create' %}" enctype="multipart/form-data">
{% csrf_token %}
{{ form|crispy }}
{{ form_blurb|crispy }}
@ -23,7 +23,7 @@
<th>#</th>
<th>Code</th>
<th>Short Description</th>
<th><a class="btn btn-primary pull-right" href="{% url 'users:access_cards:create' %}">Create</a></th>
<th><a class="btn btn-primary pull-right" href="{% url 'users:rfid:create' %}">Create</a></th>
</tr>
</thead>
{% for rfid in rfids %}
@ -36,7 +36,7 @@
{{ rfid.description }}
</td>
<td>
<a href="{% url 'users:access_cards:delete' rfid.id %}">Delete</a>
<a href="{% url 'users:rfid::delete' rfid.id %}">Delete</a>
</td>
</tr>
{% endfor %}

View File

@ -74,7 +74,7 @@
<div class="col-sm-12">
<p>
<a class="btn btn-primary" href="{% url 'users:update' %}" role="button">My Info</a>
<a class="btn btn-primary" href="{% url 'users:access_cards' %}" role="button">My Rfid Cards</a>
<a class="btn btn-primary" href="{% url 'users:rfid:index' %}" role="button">My Rfid Cards</a>
<a class="btn btn-primary" href="{% url 'account_email' %}" role="button">E-Mail</a>
</p>
<!-- Your Stuff: Custom user template urls -->

View File

@ -7,7 +7,7 @@ from mhackspace.rfid.urls import access_card_patterns
from . import views
urlpatterns = [
url('^access-cards/', include(access_card_patterns)),
url('^access-cards/', include(access_card_patterns, namespace='rfid')),
url(
regex=r'^$',
view=views.UserListView.as_view(),