Skip to content

Commit 8db1f43

Browse files
Added Changes
1 parent 5bf8175 commit 8db1f43

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

junction/profiles/urls.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55

66
urlpatterns = [
77
url(r'^$', views.dashboard, name='dashboard'),
8+
url(r'^edit/$', views.profile, name='profile'),
9+
10+
811
]

junction/profiles/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def profile(request):
4646
return HttpResponseRedirect(reverse('profiles:dashboard'))
4747

4848
elif request.method == "GET":
49-
user = get_object_or_404(User, pk=username.id)
50-
detail = get_object_or_404(Profile, user=user)
49+
user = User.objects.get(pk=username.id)
50+
detail = Profile.objects.filter(user=user).exists()
5151
if detail:
5252
return render(request, 'profiles/userprofile.html', {'detail': detail})
5353
else:

junction/templates/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@
109109
<ul class="dropdown-menu" role="menu">
110110
<li><a href="{% url 'profiles:dashboard' %}">Dashboard</a></li>
111111
<li><a href="{% url 'socialaccount_connections' %}">Social Accounts</a></li>
112+
<li><a href="{% url 'profiles:profile' %}">Profile</a></li>
112113
{% if user.is_staff %}
113114
<li><a href="{% url 'admin:index' %}" target="_blank">Admin</a></li>
114115
{% endif %}

0 commit comments

Comments
 (0)