Skip to content

Commit

Permalink
Merge pull request #59 from lionleaf/url-changes
Browse files Browse the repository at this point in the history
Make url patterns more consistent
  • Loading branch information
lionleaf authored Aug 18, 2016
2 parents e2b61f0 + cacfcd1 commit 8fff39e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions dwitter/feed/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@
url(r'^new/page/(?P<page_nr>\d+)$',
views.feed, {'sort': 'new'}, name='new_feed_page'),

url(r'^dweetreply/(?P<dweet_id>\d+)$',
url(r'^d/(?P<dweet_id>\d+)/reply$',
views.dweet_reply, name='dweet_reply'),

url(r'^d/(?P<dweet_id>\d+)/delete$',
views.dweet_delete, name='dweet_delete'),
url(r'^d/(?P<dweet_id>\d+)/like$', views.like, name='like'),

url(r'^dweet$', views.dweet, name='dweet'),
url(r'^like/(?P<post_id>\d+)$', views.like, name='like'),
]
4 changes: 2 additions & 2 deletions dwitter/feed/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ def dweet_delete(request, dweet_id):


@ajax_login_required
def like(request, post_id):
dweet = get_object_or_404(Dweet, id=post_id)
def like(request, dweet_id):
dweet = get_object_or_404(Dweet, id=dweet_id)

if(dweet.likes.filter(id=request.user.id).exists()):
liked = False
Expand Down
2 changes: 1 addition & 1 deletion dwitter/static/js/ajax-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ var processLike = function() {
}

var config = {
url: '/like/' + dweet_id,
url: '/d/' + dweet_id + '/like',
dataType: 'json',
success: processServerResponse,
};
Expand Down

0 comments on commit 8fff39e

Please sign in to comment.