Skip to content

Commit

Permalink
[Hardening] Removing wrong logic check always True
Browse files Browse the repository at this point in the history
(cherry picked from commit cf95050)
  • Loading branch information
afabiani committed Mar 25, 2021
1 parent dc45a92 commit 761772b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion geonode/br/management/commands/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,4 +478,4 @@ def empty_folder(folder):
elif os.path.isdir(file_path):
shutil.rmtree(file_path)
except Exception as e:
print('Failed to delete %s. Reason: %s' % (file_path, e))
print(f'Failed to delete {file_path}. Reason: {e}')
3 changes: 1 addition & 2 deletions geonode/geoserver/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,7 @@ def feature_edit_check(request, layername, permission='change_layer_data'):
if is_admin or is_staff or is_owner or is_manager or request.user.has_perm(
permission,
obj=layer) and \
((permission == 'change_layer_data' and layer.storeType == 'dataStore' and feature_edit) or
True):
layer.storeType == 'dataStore' and feature_edit:
return HttpResponse(
json.dumps({'authorized': True}), content_type="application/json")
else:
Expand Down

0 comments on commit 761772b

Please sign in to comment.