Skip to content

Commit

Permalink
Advanced workflow: remove change_permissions to the owner if not a ma…
Browse files Browse the repository at this point in the history
…nager
  • Loading branch information
afabiani committed Oct 22, 2020
1 parent bfe51a7 commit d9ec566
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions geonode/geoserver/createlayer/utils.py
Expand Up @@ -17,12 +17,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################

import requests
import json
import uuid
import logging
import json
import requests

from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.gis.geos import Polygon
from django.template.defaultfilters import slugify
Expand Down Expand Up @@ -77,6 +77,13 @@ def create_gn_layer(workspace, datastore, name, title, owner_name):
bbox_polygon=Polygon.from_bbox(BBOX),
data_quality_statement=DATA_QUALITY_MESSAGE,
)

if settings.ADMIN_MODERATE_UPLOADS:
layer.is_approved = False
if settings.RESOURCE_PUBLISHING:
layer.is_published = False

layer.save()
return layer


Expand Down

0 comments on commit d9ec566

Please sign in to comment.