Skip to content

Commit f49b15f

Browse files
committed
New project layout.
The individual applications are still part of an ecs super-app. With time some of them should be moved outside and converted to be standalone.
1 parent 051d388 commit f49b15f

File tree

652 files changed

+58
-25
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

652 files changed

+58
-25
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

core/bootstrap.py renamed to ecs/core/bootstrap.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from datetime import datetime
44
from dbtemplates.models import Template
55

6+
from django.conf import settings
67
from django.contrib.auth.models import Group, Permission
78
from django.contrib.sites.models import Site
89
from django.utils import timezone
@@ -63,7 +64,7 @@ def sites():
6364

6465
@bootstrap.register(depends_on=('ecs.core.bootstrap.sites',))
6566
def templates():
66-
basedir = os.path.join(os.path.dirname(__file__), '..', 'templates')
67+
basedir = os.path.join(settings.PROJECT_DIR, 'templates')
6768

6869
sites = list(Site.objects.all())
6970

@@ -349,15 +350,15 @@ def auth_user_testusers():
349350
('investigator', None, {}),
350351
('office', u'EC-Office', {'is_internal': True,}),
351352
('internal.rev', u'EC-Internal Review Group', {'is_internal': True,}),
352-
('executive', u'EC-Executive Board Group', {'is_internal': True, 'is_executive_board_member': True),
353-
('thesis.executive', u'EC-Thesis Executive Group', {'is_internal': False, 'is_executive_board_member': False),
353+
('executive', u'EC-Executive Board Group', {'is_internal': True, 'is_executive_board_member': True, }),
354+
('thesis.executive', u'EC-Thesis Executive Group', {'is_internal': False, 'is_executive_board_member': False, }),
354355
('signing', u'EC-Signing Group', {'is_internal': True, }),
355356
('signing_fail', u'EC-Signing Group', {'is_internal': True }),
356357
('signing_mock', u'EC-Signing Group', {'is_internal': True }),
357358
('statistic.rev', u'EC-Statistic Group', {'is_internal': False}),
358359
('notification.rev', u'EC-Notification Review Group', {'is_internal': True, }),
359360
('insurance.rev', u'EC-Insurance Reviewer', {'is_internal': False, 'is_insurance_reviewer': True}),
360-
('thesis.rev', u'EC-Thesis Review Group', {'is_internal': False, 'is_thesis_reviewer': True),
361+
('thesis.rev', u'EC-Thesis Review Group', {'is_internal': False, 'is_thesis_reviewer': True, }),
361362
('external.reviewer', None, {}),
362363
('gcp.reviewer', u'GCP Review Group', {'is_internal': False}),
363364
('localec.rev', u'Local-EC Review Group', {'is_internal': True}),
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

core/serializer/base.py renamed to ecs/core/serializer/base.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from django.core.files.base import ContentFile
99
from django.utils.datastructures import SortedDict
1010
from django.contrib.contenttypes import generic
11+
from django.utils import timezone
1112

1213
from ecs.core.models import SubmissionForm, Submission, EthicsCommission, Investigator, InvestigatorEmployee, Measure, ForeignParticipatingCenter, NonTestedUsedDrug
1314
from ecs.documents.models import Document, DocumentType
@@ -226,7 +227,9 @@ def load_field(self, fieldname, val, zf, version):
226227
deferr = False
227228
if field:
228229
if isinstance(field, models.DateTimeField):
229-
val = datetime.datetime.strptime(val, DATETIME_FORMAT)
230+
val = timezone.make_aware(
231+
datetime.datetime.strptime(val, DATETIME_FORMAT),
232+
timezone.utc)
230233
elif isinstance(field, models.DateField):
231234
val = datetime.date.strptime(val, DATE_FORMAT)
232235
elif isinstance(field, models.ManyToManyField):
@@ -448,7 +451,7 @@ def dump_model_instance(obj, zf):
448451
class _JsonEncoder(json.JSONEncoder):
449452
def default(self, obj):
450453
if isinstance(obj, datetime.datetime):
451-
return obj.strftime(DATETIME_FORMAT)
454+
return obj.astimezone(timezone.utc).strftime(DATETIME_FORMAT)
452455
elif isinstance(obj, datetime.date):
453456
return obj.strftime(DATE_FORMAT)
454457
return super(Encoder, self).default(obj)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

ecsmail/tests/ecsmailtest.py renamed to ecs/ecsmail/tests/ecsmailtest.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_attachments(self):
6868
that data attached is not altered.
6969
'''
7070

71-
attachment_name = os.path.join(settings.PROJECT_DIR, "core", "tests", "data", "menschenrechtserklaerung.pdf")
71+
attachment_name = os.path.join(settings.PROJECT_DIR, "ecs", "core", "tests", "data", "menschenrechtserklaerung.pdf")
7272
attachment_data = open(attachment_name, "rb").read()
7373

7474
# make two attachments, first attachment via a filename, second attachment via data supplied inline
@@ -89,7 +89,7 @@ def test_text_and_html_and_attachment(self):
8989
Further checks that attached data is not altered during sending.
9090
'''
9191

92-
attachment_name = os.path.join(settings.PROJECT_DIR, "core", "tests", "data", "menschenrechtserklaerung.pdf")
92+
attachment_name = os.path.join(settings.PROJECT_DIR, "ecs", "core", "tests", "data", "menschenrechtserklaerung.pdf")
9393
attachment_data = open(attachment_name, "rb").read()
9494

9595
self.deliver("another subject", "another attachment",
@@ -104,4 +104,4 @@ def test_text_and_html_and_attachment(self):
104104

105105
ok_(re.search("<b>bold attachment</b>", html_data))
106106
eq_(attachment_data, pdf_data)
107-
107+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)