Commit 0e718e46 authored by Brian Guadalupe's avatar Brian Guadalupe

Restrict viewing of profile pages to users only

parent c46efa41
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
{% block title %}{{profile.username}}'s Profile{% endblock %} {% block title %}{{profile.username}}'s Profile{% endblock %}
{% block content %} {% block content %}
<div class="boxified main profile"> <div class="boxified main profile">
{% if user.is_authenticated %}
<h2>{{profile.username}}'s Profile</h2> <h2>{{profile.username}}'s Profile</h2>
<ul> <ul>
<li><strong>First Name:</strong> {{profile.first_name}}</li> <li><strong>First Name:</strong> {{profile.first_name}}</li>
...@@ -12,7 +12,10 @@ ...@@ -12,7 +12,10 @@
<li><strong>Email Address:</strong> {{profile.email}}</li> <li><strong>Email Address:</strong> {{profile.email}}</li>
</ul> </ul>
{% if profile.username == user.username and user.is_authenticated %} {% if profile.username == user.username and user.is_authenticated %}
<a href="#" class="buttoned">Edit user profile</a> <a href="edit" class="buttoned">Edit user profile</a>
</div>
{% endif %} {% endif %}
{% else %}
<p>Please <a href="/login">log in</a> to your account to view {{profile.username}}'s profile.</p>
{% endif %}
</div>
{% endblock %} {% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment