From a5a876b1aaf4ed6a142e83b83d1dd6a0f7ef4286 Mon Sep 17 00:00:00 2001 From: winkidney Date: Thu, 21 Feb 2019 19:35:23 +0800 Subject: [PATCH] Fix: Fix context name-conflicts for user-page --- core/urls.py | 2 +- pinry/static/js/pin-form.js | 2 -- pinry/templates/base.html | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/core/urls.py b/core/urls.py index e9c16e6..29c45b3 100644 --- a/core/urls.py +++ b/core/urls.py @@ -7,7 +7,7 @@ urlpatterns = [ name='pin-form'), url(r'^pins/tags/(?P(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'), name='tag-pins'), - url(r'^pins/users/(?P(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'), + url(r'^pins/users/(?P(\w|-)+)/$', TemplateView.as_view(template_name='core/pins.html'), name='user-pins'), url(r'^(?P[0-9]+)/$', TemplateView.as_view(template_name='core/pins.html'), name='pin-detail'), diff --git a/pinry/static/js/pin-form.js b/pinry/static/js/pin-form.js index 8a57ccd..dbdeada 100644 --- a/pinry/static/js/pin-form.js +++ b/pinry/static/js/pin-form.js @@ -15,7 +15,6 @@ $(window).load(function() { // Start Helper Functions function getFormData() { return { - submitter: currentUser, url: $('#pin-form-image-url').val(), referer: $('#pin-form-referer').val(), description: $('#pin-form-description').val(), @@ -25,7 +24,6 @@ $(window).load(function() { function createPinPreviewFromForm() { var context = {pins: [{ - submitter: currentUser, image: {thumbnail: {image: $('#pin-form-image-url').val()}}, referer: $('#pin-form-referer').val(), description: $('#pin-form-description').val(), diff --git a/pinry/templates/base.html b/pinry/templates/base.html index 71fd284..f9822bb 100644 --- a/pinry/templates/base.html +++ b/pinry/templates/base.html @@ -36,7 +36,7 @@ }, pinFilter = "{{ request.resolver_match.kwargs.pin }}", tagFilter = "{{ request.resolver_match.kwargs.tag }}", - userFilter = "{{ request.resolver_match.kwargs.user }}"; + userFilter = "{{ request.resolver_match.kwargs.username }}";