Skip to content

Commit 3e18d61

Browse files
authored
Merge pull request #1995 from MIT-LCP/compilestatic
No downloading stuff in compilestatic
2 parents cb624ed + 9976f41 commit 3e18d61

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

.env.example

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,6 @@ LIGHT='#007FA3'
156156
GRADIENT_60 = 'rgba(42, 47, 52, 0.6)'
157157
GRADIENT_85 = 'rgba(42, 47, 52, 0.85)'
158158

159-
## physionet background image(direct download url)
160-
BACKGROUND_IMAGE='https://physionet.org/static/images/background.jpg'
161-
162-
163159
# Users settings
164160
# maximum number of emails that can be associated to a user model
165161
MAX_EMAILS_PER_USER = 10

physionet-django/user/management/commands/compilestatic.py

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# Management Command to compile static Sass files
22
import os
3-
import urllib.request
4-
import urllib.error
53
from django.core.management.base import BaseCommand, CommandError
64
from decouple import config
75
from django.core.management import call_command
@@ -36,21 +34,6 @@ def setup_theme_colors(colors):
3634
return themes_colors
3735

3836

39-
def setup_static_file(source, destination):
40-
"""
41-
Copies a static file from source to destination
42-
:param source: the source file path(direct url)
43-
:param destination: the destination file path
44-
"""
45-
46-
try:
47-
urllib.request.urlretrieve(source, destination)
48-
except urllib.error.HTTPError:
49-
raise CommandError(f'Could not download {source}')
50-
except urllib.error.URLError:
51-
raise CommandError(f'Could not download {source}')
52-
53-
5437
class Command(BaseCommand):
5538
help = 'Compile static Sass files'
5639

@@ -79,12 +62,6 @@ def handle(self, *args, **options):
7962
# writing the success message
8063
self.stdout.write(self.style.SUCCESS('Successfully compiled static Sass files'))
8164

82-
# setup background image
83-
image_source = config('BACKGROUND_IMAGE', default='https://physionet.org/static/images/background.jpg')
84-
image_destination = 'static/images/background.jpg'
85-
setup_static_file(image_source, image_destination)
86-
self.stdout.write(self.style.SUCCESS('Successfully setup background image'))
87-
8865
# Demo section for home.css
8966
theme_generator(themes_colors, imports=['../../custom/scss/home'])
9067
call_command('sass', 'static/bootstrap/scss/theme.scss', 'static/custom/css/home.css')

0 commit comments

Comments
 (0)