Skip to content

Commit 5710186

Browse files
committed
Merge branch 'release/next-djangole'
2 parents 5a743d5 + b058889 commit 5710186

File tree

375 files changed

+9399
-4934
lines changed

Some content is hidden

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

375 files changed

+9399
-4934
lines changed

.docker-compose.mfr.env

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,16 @@ SERVER_CONFIG_HMAC_SECRET=changeme
77
SERVER_CONFIG_ADDRESS=0.0.0.0
88
SERVER_CONFIG_ALLOWED_PROVIDER_DOMAINS='http://192.168.168.167:5000/ http://192.168.168.167:7777/'
99

10+
UNOCONV_PORT_2002_TCP_ADDR=192.168.168.167
11+
12+
# Related settings from MFR mfr/extensions/settings.py
13+
# These settings are used for changing URI in templates for renderers that download from
14+
# waterbutler in template. e.g. 192.168.168.167 -> localhost
15+
# LOCAL_DEVELOPMENT = config.get_bool('LOCAL_DEVELOPMENT', 0)
16+
# DOCKER_LOCAL_HOST = config.get('DOCKER_LOCAL_HOST', '192.168.168.167')
17+
# LOCAL_HOST = config.get('LOCAL_HOST', 'localhost')
18+
19+
# Indicates use of local docker development setup
20+
EXTENSION_CONFIG_LOCAL_DEVELOPMENT=1
21+
1022
#PYTHONUNBUFFERED=0 # This when set to 0 will allow print statements to be visible in the Docker logs

.pyup.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pin: True
2+
# schedule: "every week"
3+
search: True

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
- WHEELHOUSE="$HOME/.cache/wheelhouse"
2424
- LIBXML2_DEB="libxml2-dbg_2.9.1+dfsg1-3ubuntu4.9_amd64.deb"
2525
- POSTGRES_DEB="postgresql-9.6_9.6.3-1.pgdg12.4+1_amd64.deb"
26-
- ELASTICSEARCH_ARCHIVE="elasticsearch-1.5.0.tar.gz"
26+
- ELASTICSEARCH_ARCHIVE="elasticsearch-2.4.5.tar.gz"
2727
- LIBJEMALLOC_DEB="libjemalloc1_3.5.1-2_amd64.deb"
2828
- LIBPCRE_DEB="libpcre3_8.31-2ubuntu2.3_amd64.deb"
2929
# - VARNISH_DEB="varnish_4.1.0-1~trusty_amd64.deb"

CHANGELOG

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
Changelog
33
*********
44

5+
0.125.0 (2017-12-05)
6+
====================
7+
8+
- Add GitLab addon
9+
- Add OneDrive addon
10+
- Upgrade a number of Python dependencies
11+
- Use django-celery-beat for managing periodic tasks
12+
- Optimizations for files grid and adding contributors
13+
- APIv2 optimizations
14+
- Admin: Add custom taxonomy UI
15+
- Quick files UI on profile pages
16+
- APIv2 immediately returns preprint DOIs
17+
- Add `created` and `modified` fields to all models
18+
- Address Django deprecation warnings
19+
- Remove modularmodm as a dependency
20+
- Remove redundant osf.utils.auth module
21+
522
0.124.0 (2017-11-13)
623
====================
724

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ COPY ./addons/dropbox/requirements.txt ./addons/dropbox/
103103
#COPY ./addons/figshare/requirements.txt ./addons/figshare/
104104
#COPY ./addons/forward/requirements.txt ./addons/forward/
105105
COPY ./addons/github/requirements.txt ./addons/github/
106+
COPY ./addons/gitlab/requirements.txt ./addons/gitlab/
106107
#COPY ./addons/googledrive/requirements.txt ./addons/googledrive/
107108
COPY ./addons/mendeley/requirements.txt ./addons/mendeley/
109+
COPY ./addons/onedrive/requirements.txt /code/addons/onedrive/
108110
#COPY ./addons/osfstorage/requirements.txt ./addons/osfstorage/
109111
COPY ./addons/owncloud/requirements.txt ./addons/owncloud/
110112
COPY ./addons/s3/requirements.txt ./addons/s3/
@@ -152,8 +154,10 @@ COPY ./addons/dropbox/static/ ./addons/dropbox/static/
152154
COPY ./addons/figshare/static/ ./addons/figshare/static/
153155
COPY ./addons/forward/static/ ./addons/forward/static/
154156
COPY ./addons/github/static/ ./addons/github/static/
157+
COPY ./addons/gitlab/static/ ./addons/gitlab/static/
155158
COPY ./addons/googledrive/static/ ./addons/googledrive/static/
156159
COPY ./addons/mendeley/static/ ./addons/mendeley/static/
160+
COPY ./addons/onedrive/static/ /code/addons/onedrive/static/
157161
COPY ./addons/osfstorage/static/ ./addons/osfstorage/static/
158162
COPY ./addons/owncloud/static/ ./addons/owncloud/static/
159163
COPY ./addons/s3/static/ ./addons/s3/static/

addons.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
"figshare",
77
"forward",
88
"github",
9+
"gitlab",
910
"mendeley",
1011
"zotero",
1112
"osfstorage",
1213
"owncloud",
14+
"onedrive",
1315
"s3",
1416
"twofactor",
1517
"wiki",
@@ -24,7 +26,9 @@
2426
"figshare": "partial",
2527
"forward": "full",
2628
"googledrive": "partial",
29+
"onedrive": "partial",
2730
"github": "partial",
31+
"gitlab": "partial",
2832
"owncloud": "partial",
2933
"s3": "partial",
3034
"wiki": "full",
@@ -37,14 +41,17 @@
3741
"dropbox",
3842
"figshare",
3943
"github",
44+
"gitlab",
4045
"googledrive",
4146
"owncloud",
4247
"s3",
43-
"bitbucket"
48+
"bitbucket",
49+
"onedrive"
4450
],
4551
"addons_based_on_ids": [
4652
"osfstorage",
47-
"box"
53+
"box",
54+
"onedrive"
4855
],
4956
"addons_description": {
5057
"box": "Box is a file storage add-on. Connect your Box account to an OSF project to interact with files hosted on Box via the OSF.",
@@ -53,6 +60,7 @@
5360
"figshare": "Figshare is an online digital repository. Connect your figshare account to share your figshare files along with other materials in your OSF project.",
5461
"forward": "The External Link add-on allows you to provide a link to a website outside of the OSF.",
5562
"github": "GitHub is a web-based Git repository hosting service. Connect your GitHub repo to your OSF project to share your code alongside other materials in your OSF project.",
63+
"gitlab": "GitLab is an open-source web-based Git repository hosting tool and service. Connect your GitLab repo to your OSF project to share your code alongside other materials in your OSF project.",
5664
"mendeley": "Mendeley is a reference management tool. Connecting Mendeley folders to OSF projects allows you and others to view, copy, and download citations that are relevant to your project from the Project Overview page.",
5765
"zotero": "Zotero is a reference management tool. Connecting Zotero folders to OSF projects allows you and others to view, copy, and download citations that are relevant to your project from the Project Overview page.",
5866
"osfstorage": "OSF Storage is the default storage provider for OSF projects.",
@@ -61,19 +69,22 @@
6169
"twofactor": "Two-factor authentication is a security add-on. By using two-factor authentication, you'll protect your OSF account with both your password and your mobile phone.",
6270
"wiki": "The wiki is a versatile communication tool. Wikis can be used to explain the main points of your project and can contain information like lab notes or contact information.",
6371
"googledrive": "Google Drive is a file storage add-on. Connect your Google Drive account to an OSF project to interact with files hosted on Google Drive via the OSF.",
64-
"bitbucket": "Bitbucket is a web-based Git repository hosting service. Connect your Bitbucket repo to your OSF project to share your code alongside other materials in your OSF project."
72+
"bitbucket": "Bitbucket is a web-based Git repository hosting service. Connect your Bitbucket repo to your OSF project to share your code alongside other materials in your OSF project.",
73+
"onedrive": "Microsoft OneDrive is a file storage add-on. Connect your Microsoft OneDrive account to an OSF project to interact with files hosted on Microsoft OneDrive via the OSF."
6574
},
6675
"addons_url": {
6776
"box": "http://www.box.com",
6877
"dataverse": "https://dataverse.harvard.edu/",
6978
"dropbox": "http://www.dropbox.com",
7079
"figshare": "http://www.figshare.com",
7180
"github": "http://www.github.com",
81+
"gitlab": "https://www.gitlab.com",
7282
"mendeley": "http://www.mendeley.com",
7383
"owncloud": "https://owncloud.org/",
7484
"zotero": "http://www.zotero.org",
7585
"s3": "https://aws.amazon.com/s3/",
7686
"googledrive": "https://drive.google.com",
77-
"bitbucket": "https://bitbucket.org/"
87+
"bitbucket": "https://bitbucket.org/",
88+
"onedrive": "https://onedrive.live.com"
7889
}
7990
}

addons/base/models.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def on_delete(self):
8484

8585

8686
class BaseUserSettings(BaseAddonSettings):
87-
owner = models.OneToOneField(OSFUser, blank=True, null=True, related_name='%(app_label)s_user_settings')
87+
owner = models.OneToOneField(OSFUser, related_name='%(app_label)s_user_settings',
88+
blank=True, null=True, on_delete=models.CASCADE)
8889

8990
class Meta:
9091
abstract = True
@@ -347,7 +348,8 @@ def on_delete(self):
347348

348349

349350
class BaseNodeSettings(BaseAddonSettings):
350-
owner = models.OneToOneField(AbstractNode, null=True, blank=True, related_name='%(app_label)s_node_settings')
351+
owner = models.OneToOneField(AbstractNode, related_name='%(app_label)s_node_settings',
352+
null=True, blank=True, on_delete=models.CASCADE)
351353

352354
class Meta:
353355
abstract = True
@@ -540,7 +542,7 @@ class GenericRootNode(object):
540542
name = ''
541543

542544

543-
class BaseStorageAddon(BaseModel):
545+
class BaseStorageAddon(object):
544546
"""
545547
Mixin class for traversing file trees of addons with files
546548
"""
@@ -607,7 +609,8 @@ class BaseOAuthNodeSettings(BaseNodeSettings):
607609
# TODO: Validate this field to be sure it matches the provider's short_name
608610
# NOTE: Do not set this field directly. Use ``set_auth()``
609611
external_account = models.ForeignKey(ExternalAccount, null=True, blank=True,
610-
related_name='%(app_label)s_node_settings')
612+
related_name='%(app_label)s_node_settings',
613+
on_delete=models.CASCADE)
611614

612615
# NOTE: Do not set this field directly. Use ``set_auth()``
613616
# user_settings = fields.AbstractForeignField()
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.2 on 2017-08-08 16:40
3+
from __future__ import unicode_literals
4+
import datetime
5+
import pytz
6+
7+
from django.db import migrations
8+
import django_extensions.db.fields
9+
10+
11+
class Migration(migrations.Migration):
12+
13+
dependencies = [
14+
('addons_bitbucket', '0001_initial'),
15+
]
16+
17+
operations = [
18+
migrations.AddField(
19+
model_name='nodesettings',
20+
name='created',
21+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
22+
preserve_default=False,
23+
),
24+
migrations.AddField(
25+
model_name='nodesettings',
26+
name='modified',
27+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
28+
),
29+
migrations.AddField(
30+
model_name='usersettings',
31+
name='created',
32+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
33+
preserve_default=False,
34+
),
35+
migrations.AddField(
36+
model_name='usersettings',
37+
name='modified',
38+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
39+
),
40+
]

addons/bitbucket/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def fetch_access_token(self, force_refresh=False):
8080
return self.account.oauth_key
8181

8282

83-
class UserSettings(BaseStorageAddon, BaseOAuthUserSettings):
83+
class UserSettings(BaseOAuthUserSettings):
8484
"""Stores user-specific bitbucket information
8585
8686
Quirks::
@@ -101,14 +101,14 @@ def public_id(self):
101101
return None
102102

103103

104-
class NodeSettings(BaseStorageAddon, BaseOAuthNodeSettings):
104+
class NodeSettings(BaseOAuthNodeSettings, BaseStorageAddon):
105105
oauth_provider = BitbucketProvider
106106
serializer = BitbucketSerializer
107107

108108
user = models.TextField(blank=True, null=True)
109109
repo = models.TextField(blank=True, null=True)
110110
hook_id = models.TextField(blank=True, null=True)
111-
user_settings = models.ForeignKey(UserSettings, null=True, blank=True)
111+
user_settings = models.ForeignKey(UserSettings, null=True, blank=True, on_delete=models.CASCADE)
112112

113113
_api = None
114114

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.2 on 2017-07-13 16:25
3+
from __future__ import unicode_literals
4+
import pytz
5+
6+
import datetime
7+
from django.db import migrations
8+
import django_extensions.db.fields
9+
10+
11+
class Migration(migrations.Migration):
12+
13+
dependencies = [
14+
('addons_box', '0002_auto_20170323_1534'),
15+
]
16+
17+
operations = [
18+
migrations.AddField(
19+
model_name='nodesettings',
20+
name='created',
21+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
22+
preserve_default=False,
23+
),
24+
migrations.AddField(
25+
model_name='nodesettings',
26+
name='modified',
27+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
28+
),
29+
migrations.AddField(
30+
model_name='usersettings',
31+
name='created',
32+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
33+
preserve_default=False,
34+
),
35+
migrations.AddField(
36+
model_name='usersettings',
37+
name='modified',
38+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
39+
),
40+
]

addons/box/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class NodeSettings(BaseOAuthNodeSettings, BaseStorageAddon):
9999
folder_id = models.TextField(null=True, blank=True)
100100
folder_name = models.TextField(null=True, blank=True)
101101
folder_path = models.TextField(null=True, blank=True)
102-
user_settings = models.ForeignKey(UserSettings, null=True, blank=True)
102+
user_settings = models.ForeignKey(UserSettings, null=True, blank=True, on_delete=models.CASCADE)
103103

104104
_api = None
105105

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# -*- coding: utf-8 -*-
2+
# Generated by Django 1.11.2 on 2017-07-13 16:25
3+
from __future__ import unicode_literals
4+
import pytz
5+
6+
import datetime
7+
from django.db import migrations
8+
import django_extensions.db.fields
9+
10+
11+
class Migration(migrations.Migration):
12+
13+
dependencies = [
14+
('addons_dataverse', '0002_auto_20170323_1534'),
15+
]
16+
17+
operations = [
18+
migrations.AddField(
19+
model_name='nodesettings',
20+
name='created',
21+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
22+
preserve_default=False,
23+
),
24+
migrations.AddField(
25+
model_name='nodesettings',
26+
name='modified',
27+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
28+
),
29+
migrations.AddField(
30+
model_name='usersettings',
31+
name='created',
32+
field=django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, default=datetime.datetime(1970, 1, 1, 0, 0, tzinfo=pytz.utc), verbose_name='created'),
33+
preserve_default=False,
34+
),
35+
migrations.AddField(
36+
model_name='usersettings',
37+
name='modified',
38+
field=django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified'),
39+
),
40+
]

addons/dataverse/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from framework.auth.decorators import Auth
88
from framework.exceptions import HTTPError
99
from osf.models.files import File, Folder, FileVersion, BaseFileNode
10-
from osf.utils.auth import _get_current_user
10+
from framework.auth.core import _get_current_user
1111
from addons.base import exceptions
1212
from addons.dataverse.client import connect_from_settings_or_401
1313
from addons.dataverse.serializer import DataverseSerializer
@@ -74,7 +74,7 @@ class UserSettings(BaseOAuthUserSettings):
7474
serializer = DataverseSerializer
7575

7676

77-
class NodeSettings(BaseStorageAddon, BaseOAuthNodeSettings):
77+
class NodeSettings(BaseOAuthNodeSettings, BaseStorageAddon):
7878
oauth_provider = DataverseProvider
7979
serializer = DataverseSerializer
8080

@@ -83,7 +83,7 @@ class NodeSettings(BaseStorageAddon, BaseOAuthNodeSettings):
8383
dataset_doi = models.TextField(blank=True, null=True)
8484
_dataset_id = models.TextField(blank=True, null=True)
8585
dataset = models.TextField(blank=True, null=True)
86-
user_settings = models.ForeignKey(UserSettings, null=True, blank=True)
86+
user_settings = models.ForeignKey(UserSettings, null=True, blank=True, on_delete=models.CASCADE)
8787

8888
@property
8989
def folder_name(self):

0 commit comments

Comments
 (0)