Skip to content

Commit

Permalink
change to is_public
Browse files Browse the repository at this point in the history
  • Loading branch information
backface committed Oct 10, 2024
1 parent 4c10fd3 commit c6c74b5
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
4 changes: 3 additions & 1 deletion api/api_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ def set_project_visibility(
project.last_shared = timezone.now()
else:
project.last_shared = None
if not ispublished is not None:

# we set is published but it is ignored for now!
if ispublished is not None:
project.is_published = ispublished

project.save()
Expand Down
1 change: 1 addition & 0 deletions pyrightconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"reportFunctionMemberAccess": false,
"reportOptionalMemberAccess": false,

"reportAssignmentType": false,
"reportArgumentType": false,
"reportCallIssue": false,
"reportPossiblyUnboundVariable": false
Expand Down
2 changes: 1 addition & 1 deletion templates/projects/_is_shared.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</a><br>
</div>

{% if request.user == project.user or request.user.is_superuser or request.user.is_moderator %}
{% if request.user == project.user %}
<a
hx-target="#sharer"
hx-swap="innerHTML"
Expand Down
2 changes: 1 addition & 1 deletion templates/projects/_is_unshared.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div id="sharing">
<div></div>
{% if request.user == project.user or request.user.is_superuser or request.user.is_moderator %}
{% if request.user == project.user %}
This project is private.<br>
<a
hx-target="#sharer"
Expand Down
6 changes: 3 additions & 3 deletions templates/projects/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ <h4 class="inline">{% trans "Tags" %}:</h4>
{% include "projects/_project_stats.html" %}
</div>
<div id="sharer" class="p-1 pt-3 mt-4">
{% if project.last_shared %}
{% if project.is_public %}
{% include "projects/_is_shared.html" %}
{% else %}
{% include "projects/_is_unshared.html" %}
Expand All @@ -137,7 +137,7 @@ <h4 class="inline">{% trans "Tags" %}:</h4>
</div>

<div class="mt-3 text-green-800">
{% if request.user == project.user or request.user.is_superuser or request.user.is_moderator %}
{% if request.user == project.user %}
<a href="{% url 'projects:edit' project.id %}">
<button><i class="icon-[ion--edit] mr-1"></i> Edit</button>
</a>
Expand All @@ -154,7 +154,7 @@ <h4 class="inline">{% trans "Tags" %}:</h4>
<button class="bg-orange-600"><i class="icon-[ion--flag] mr-1"></i> Report as inappropriate</button>
</a>
{% endif %}
{% if request.user.is_superuser or request.user.is_editor %}
{% if request.user.is_superuser or request.user.is_editor or request.user.is_moderator %}
<button class="bg-primary" x-on:click="htmx.find('#categoryform').classList.toggle('hidden')" x-data>
<i class="icon-[ion--save] mr-1"></i> Edit Categories
</button>
Expand Down

0 comments on commit c6c74b5

Please sign in to comment.