Skip to content

Commit

Permalink
related with #71: modified view function's name
Browse files Browse the repository at this point in the history
  • Loading branch information
punkyoon committed Jul 20, 2017
1 parent a7959ad commit eeae96c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions coding_night_live/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
url(r'^$', MainView.as_view(), name='main'),
url(r'^admin/', admin.site.urls),
url(r'^accounts/', include(custom_conf)),
url(r'^services/$', manage_room.views.RoomListView, name='services'),
url(r'^services/new/', manage_room.views.RoomCreateView, name='new'),
url(r'^services/$', manage_room.views.room_list_view, name='services'),
url(r'^services/new/', manage_room.views.room_create_view, name='new'),
url(
r'^services/delete/(?P<pk>([a-z]{3,}-[a-z]{3,}-[0-9]{1,4}))/$',
manage_room.views.RoomDeleteView,
manage_room.views.room_delete_view,
name='delete'
),
url(
Expand All @@ -44,7 +44,7 @@
),
url(
r'^([a-z]{3,}-[a-z]{3,}-[0-9]{1,4})/pdf/$',
manage_room.views.MarkdownToPdfView,
manage_room.views.markdown_to_pdf_view,
name='get_pdf'
),
url(r'^auth/', include('django.contrib.auth.urls'), {'next_page': '/'}),
Expand Down
8 changes: 4 additions & 4 deletions manage_room/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


@login_required
def RoomCreateView(request):
def room_create_view(request):
url = '/'
room = None

Expand Down Expand Up @@ -41,21 +41,21 @@ def RoomCreateView(request):

# Delete a room
@login_required
def RoomDeleteView(request, pk):
def room_delete_view(request, pk):
Room.objects.filter(admin_user=request.user, label=pk).delete()
url = '/services'
return HttpResponseRedirect(url)


# Check room list
@login_required
def RoomListView(request):
def room_list_view(request):
rooms = Room.objects.filter(admin_user=request.user).order_by('time')
return render(request, 'list.html', {'rooms': rooms})


# Convert markdown to pdf
def MarkdownToPdfView(request, label):
def markdown_to_pdf_view(request, label):
label = label.strip('/')
try:
room = Room.objects.get(label=label)
Expand Down

0 comments on commit eeae96c

Please sign in to comment.