Skip to content

Commit

Permalink
[Fixes GeoNode#4322]
Browse files Browse the repository at this point in the history
  • Loading branch information
afabiani committed May 31, 2019
1 parent 8d487b7 commit d0bc1ce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion geonode/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,11 @@

# Uploader Settings
DATA_UPLOAD_MAX_NUMBER_FIELDS = 100000
"""
DEFAULT_BACKEND_UPLOADER = {'geonode.rest', 'geonode.importer'}
"""
UPLOADER = {
'BACKEND': os.getenv('DEFAULT_BACKEND_UPLOADER', 'geonode.importer'),
'BACKEND': os.getenv('DEFAULT_BACKEND_UPLOADER', 'geonode.rest'),
'OPTIONS': {
'TIME_ENABLED': ast.literal_eval(os.getenv('TIME_ENABLED', 'False')),
'MOSAIC_ENABLED': ast.literal_eval(os.getenv('MOSAIC_ENABLED', 'False')),
Expand Down
3 changes: 2 additions & 1 deletion geonode/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,8 @@ def request(self, url, method='GET', data=None, headers={}, stream=False, timeou
valid_uname_pw = base64.b64encode(
b"%s:%s" % (self.username, self.password)).decode("ascii")
headers['Authorization'] = 'Basic {}'.format(valid_uname_pw)
if not connection.cursor().db.vendor in ('sqlite', 'sqlite3', 'spatialite',):
if self.username != 'admin' and \
connection.cursor().db.vendor not in ('sqlite', 'sqlite3', 'spatialite'):
try:
_u = user or get_user_model().objects.get(username=self.username)
access_token = get_or_create_token(_u)
Expand Down

0 comments on commit d0bc1ce

Please sign in to comment.