Skip to content

Commit

Permalink
Fix admin status detection and iframe URL routing
Browse files Browse the repository at this point in the history
- Update common_data view to correctly determine admin status for non-authenticated users
- Modify profile list template to remove unnecessary parameter in iframe URL
  • Loading branch information
NagiPragalathan committed Feb 10, 2025
1 parent 9fa7d7b commit 25406cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 2 deletions.
Binary file modified base/views/__pycache__/common.cpython-312.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion base/views/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def common_data(request):
'is_admin': 1 if is_admin else 0
})
else:

is_admin = request.user.is_superuser or request.user.is_staff
context.update({
'usr_name': "No name",
'unseen_messages_count': 0,
Expand Down
2 changes: 1 addition & 1 deletion templates/custom_admin/chapter/profile/profile_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ <h2 class="text-3xl font-bold text-center mb-8 text-gray-800">Profile Management
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap">
<a href="{% url 'iframe' profile.user.username 1 %}" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
<a href="{% url 'iframe' profile.user.username %}" class="inline-flex items-center px-4 py-2 bg-blue-600 text-white font-semibold rounded-lg hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors">
<i class="fas fa-edit mr-2"></i> Edit
</a>
</td>
Expand Down

0 comments on commit 25406cf

Please sign in to comment.