Merge remote-tracking branch 'origin/master'

This commit is contained in:
Weblate 2018-06-27 18:44:22 +00:00
commit 1acbd07113
3 changed files with 10 additions and 4 deletions

View File

@ -53,13 +53,15 @@ class FileTests(TestCase):
})
data = response.json()
self.assertIsInstance(data['id'], int)
self.assertEqual(data['is_valid'], True)
response = self.client.post(reverse('files:delete', kwargs={
'pk': data['id']
}))
self.assertEqual(response.status_code, 200)
data = response.json()
self.assertEqual(data['success'], True)

View File

@ -18,7 +18,8 @@ class FileUploadView(LoginRequiredMixin, FormView):
self.object.save()
return JsonResponse({
'is_valid': True, 'url': self.object.file.url,
'is_valid': True,
'url': self.object.file.url,
'name': self.object.file.name,
'id': self.object.pk
})
@ -45,7 +46,7 @@ class FileDeleteView(LoginRequiredMixin, DetailView):
raise PermissionDenied
self.object.delete()
return JsonResponse({
'success': True
})

View File

@ -194,7 +194,10 @@ LOCALE_PATHS = [
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
AWS_S3_ENDPOINT_URL = "https://ojuso-media.nyc3.digitaloceanspaces.com"
AWS_STORAGE_BUCKET_NAME = "ojuso-media"
if DEBUG:
AWS_STORAGE_BUCKET_NAME = "debug-test"
else:
AWS_STORAGE_BUCKET_NAME = "ojuso-media"
AWS_LOCATION = ""
AWS_S3_REGION_NAME = "nyc3"
AWS_S3_CUSTOM_DOMAIN = "ojuso-media.nyc3.digitaloceanspaces.com/ojuso-media"