Skip to content

Commit

Permalink
Merge pull request #480 from opengisch/whatever
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jan 27, 2023
1 parent 874e616 commit 5fa6445
Show file tree
Hide file tree
Showing 9 changed files with 262 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,4 @@ def handle(self, *args, **options):
self.stdout.write(f'Deleting project files for "{project_id}"...')

if not dry_run:
storage.delete_project_files(project_id)
storage.delete_all_project_files_permanently(project_id)
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
from qfieldcloud.core.utils import get_project_files_count, get_s3_bucket
from qfieldcloud.core.utils2 import storage

from .utils import setup_subscription_plans

class NormalizeBookTitlesTests(TestCase):

class QfcTestCase(TestCase):
def setUp(self):
setup_subscription_plans()

self.u1 = Person.objects.create(username="u1")
self.projects = []

Expand Down
4 changes: 4 additions & 0 deletions docker-app/qfieldcloud/core/tests/test_qgis_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import tempfile
import time
from pathlib import PurePath
from unittest import skip

from django.core.management import call_command
from django.http import FileResponse
Expand Down Expand Up @@ -559,6 +560,9 @@ def read_version(n):
self.assertEqual(read_version(0), "v17")
self.assertEqual(read_version(2), "v19")

@skip(
"Temporary disable the purge old versions, as we temporarily disabled purging old versions."
)
def test_purge_old_versions(self):
"""This tests automated purging of old versions when uploading files"""

Expand Down
5 changes: 0 additions & 5 deletions docker-app/qfieldcloud/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ def total_size(self) -> int:
# latest is also in versions
return sum(v.size for v in self.versions)

def delete(self):
bucket = get_s3_bucket()

return bucket.object_versions.filter(Prefix=self.latest.key).delete()


def redis_is_running() -> bool:
try:
Expand Down
Loading

0 comments on commit 5fa6445

Please sign in to comment.