Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SS-1229 Fix of the bug not saving deleted on date #264

Merged
merged 8 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 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
4 changes: 2 additions & 2 deletions apps/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import subprocess
import uuid
from datetime import datetime

import yaml
from celery import shared_task
Expand Down Expand Up @@ -163,9 +162,10 @@ def delete_resource(serialized_instance):
if success:
if instance.app.slug in ("volumeK8s", "netpolicy"):
instance.app_status.status = "Deleted"
instance.deleted_on = datetime.now()
instance.deleted_on = timezone.now()
else:
instance.app_status.status = "Deleting..."
instance.deleted_on = timezone.now()
else:
instance.app_status.status = "FailedToDelete"

Expand Down
3 changes: 1 addition & 2 deletions projects/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import collections
import json
from datetime import datetime

from celery import shared_task
from django.apps import apps
Expand Down Expand Up @@ -171,7 +170,7 @@ def delete_project(project_pk):
delete_project_apps(project)

project.status = "deleted"
project.deleted_on = datetime.now()
project.deleted_on = timezone.now()
project.save()


Expand Down
3 changes: 3 additions & 0 deletions studio/settings.py
akochari marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
# Since this file is only used for development, we can have this set to all hosts.
ALLOWED_HOSTS = ["*"]

# Timezone settings
USE_TZ = True
TIME_ZONE = "Europe/Stockholm"

# For django-wiki
SITE_ID = 1
Expand Down
7 changes: 3 additions & 4 deletions templates/apps/create_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
<h1 class="h3 mb-3 card-title">Edit {{ form.instance.name }}</h1>
{% else %}
<h1 class="h3 mb-3 card-title">Create {{ form.model_name }}</h1>
<p class="card-text">
{% endif %}
<div class="card-text">
{% block app_info %}
{% endblock %}
</p>
{% endif %}

</div>
</div>
<div>
{% crispy form %}
Expand Down
14 changes: 9 additions & 5 deletions templates/apps/create_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,19 @@

{% block app_info %}
{% if app_slug == 'customapp' %}
<p>This form allows you to start hosting a custom app that fulfills certain requirements on SciLifeLab Serve (the app itself can be built on any framework). Please read our <a href="/docs/application-hosting/other/">documentation page on custom apps</a> for the list of requirements and step-by-step instructions on deployment.</p>
<p>This form allows you to host a custom app that fulfills certain requirements on SciLifeLab Serve (the app itself can be built on any framework). Please read our documentation <a href="/docs/application-hosting/other/">page on custom apps</a> for the list of requirements and step-by-step instructions on deployment.</p>
{% elif app_slug == 'dashapp' %}
<p>This form allows you to start hosting a Dash app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/dash/">documentation page on Dash apps</a> for step-by-step instructions.</p>
<p>This form allows you to host a Dash app at SciLifeLab Serve. Please read our documentation <a href="/docs/application-hosting/dash/">page on Dash apps</a> for step-by-step instructions.</p>
{% elif app_slug in 'shinyapp,shinyproxyapp' %}
<p>This form allows you to start hosting a Shiny app at SciLifeLab Serve. Please read our <a href="/docs/application-hosting/shiny/">documentation page on Shiny apps</a> for step-by-step instructions.</p>
<p>This form allows you to host a Shiny app at SciLifeLab Serve. Please read our documentation <a href="/docs/application-hosting/shiny/">page on Shiny apps</a> for step-by-step instructions.</p>
{% elif app_slug == 'tissuumaps' %}
<p>This form allows you to start hosting your own TissUUmaps instance at SciLifeLab Serve. After your app has been created you will need to upload the data to your project. We suggest that you create the app with Permissions initially set to <i>Private</i>, upload the data, and then edit the app settings to change the Permissions to <i>Public</i>. Please read our <a href="/docs/application-hosting/tissuumaps/" target="_blank">documentation page on TissUUmaps apps</a> for step-by-step instructions.</p>
<p>This form allows you to host your own TissUUmaps instance at SciLifeLab Serve. After your app has been created you will need to upload the data to your project. We suggest that you create the app with Permissions initially set to <i>Private</i>, upload the data, and then edit the app settings to change the Permissions to <i>Public</i>. Please read our documentation <a href="/docs/application-hosting/tissuumaps/" target="_blank">page on TissUUmaps apps</a> for step-by-step instructions.</p>
{% elif app_slug == 'gradio' %}
<p>This form allows you to host a Gradio app at SciLifeLab Serve. Please read our documentation <a href="/docs/application-hosting/gradio/">page on Gradio apps</a> for step-by-step instructions.</p>
{% elif app_slug == 'streamlit' %}
<p>This form allows you to host a Streamlit app at SciLifeLab Serve. Please read our documentation <a href="/docs/application-hosting/streamlit/">page on Streamlit apps</a> for step-by-step instructions.</p>
{% endif %}
{% if app_slug in 'jupyter-lab,rstudio,vscode' %}
{% if app_slug in 'jupyter-lab,rstudio,vscode' and not app_id %}
<p>Note that <b>after 7 days the created {{ form.model_name }} instance will be deleted</b>, only the files saved in 'project-vol' will stay available.</p>
<p>Each {{ form.model_name }} instance can get access to the persistent volume (folder) associated with this project, called 'project-vol'. Please make sure to save all your data files, script files, output from computations, etc. inside 'project-vol'; the files located elsewhere can be deleted at any point. The files saved inside 'project-vol' will be available across all instances of {{ form.model_name }} (as well as other apps) within this project.</p>

Expand Down
Loading