Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ twisted/*.sqlite3

.env
twisted/.env

.logs
2 changes: 1 addition & 1 deletion twisted/twisted_site/templates/client/dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<main class="h-full w-full bg-gradbg text-foreground overflow-clip">
<img src="{% static 'images/twisted_logo.png' %}"
alt=""
class="fixed inset-0 z-0 bg-[url('static/images/twisted_logo.png')] pointer-events-none select-none my-auto justify-self-center opacity-60 bg-contain bg-scale scale-95 drop-shadow-lg shadow-primary" />
class="fixed inset-0 z-0 bg-[url('/static/images/twisted_logo.png')] pointer-events-none select-none my-auto justify-self-center opacity-60 bg-contain bg-scale scale-95 drop-shadow-lg shadow-primary" />
<div class="relative z-10">
<div class="flex flex-col flex-wrap content-start gap-3 w-full h-full overflow-y-hidden p-5">
{% if user.profile.is_staff %}
Expand Down
7 changes: 5 additions & 2 deletions twisted/twisted_site/views/client/journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
from django.shortcuts import get_object_or_404, redirect, render
from django.views import View

from twisted_site.models import Journal, Project, TemplateContext
from ...models import Journal, Project, TemplateContext

Check failure on line 8 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (TID252)

twisted/twisted_site/views/client/journal.py:8:1: TID252 Prefer absolute imports over relative imports from parent modules help: Replace relative imports from parent modules with absolute imports

Check failure on line 8 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (TID252)

twisted/twisted_site/views/client/journal.py:8:1: TID252 Prefer absolute imports over relative imports from parent modules help: Replace relative imports from parent modules with absolute imports

Check failure on line 8 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (TID252)

twisted/twisted_site/views/client/journal.py:8:1: TID252 Prefer absolute imports over relative imports from parent modules help: Replace relative imports from parent modules with absolute imports
from ...slack import log_to_channel

Check failure on line 9 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (TID252)

twisted/twisted_site/views/client/journal.py:9:1: TID252 Prefer absolute imports over relative imports from parent modules help: Replace relative imports from parent modules with absolute imports

HACKATIME_MAX_LOGGABLE_MINUTES = 6 * 60
IMAGE_REGEX = r"!\[([^\]]*)\]\([^)]+\)"
Expand Down Expand Up @@ -77,6 +78,8 @@
context={"content": content},
)

log_to_channel(f":haiku: *New journal for {project.project_name}!\n- {journal.time_logged} minutes")

Check failure on line 81 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (F821)

twisted/twisted_site/views/client/journal.py:81:79: F821 Undefined name `journal`

Check failure on line 82 in twisted/twisted_site/views/client/journal.py

View workflow job for this annotation

GitHub Actions / build

ruff (W293)

twisted/twisted_site/views/client/journal.py:82:1: W293 Blank line contains whitespace help: Remove whitespace from blank line
journal = Journal(
project=project,
type="hackatime",
Expand Down Expand Up @@ -224,6 +227,6 @@
if journal.type != "untracked":
return redirect("dashboard")

_ = journal.delete()
journal.delete()

return self.get(request, journal_id=None, context={"success": True})
Loading