Skip to content

Commit

Permalink
[Fixes #7237 ] Remove slack contrib support (#7239)
Browse files Browse the repository at this point in the history
* fix 7237

* restore wrong line removal
  • Loading branch information
giohappy authored Apr 7, 2021
1 parent 073d9a5 commit 52340e4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 24 deletions.
9 changes: 0 additions & 9 deletions geonode/documents/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,15 +268,6 @@ def form_valid(self, form):
bbox = BBOXHelper.from_xy(bbox)
self.object.bbox_polygon = bbox.as_polygon()

if getattr(settings, 'SLACK_ENABLED', False):
try:
from geonode.contrib.slack.utils import build_slack_message_document, send_slack_message
send_slack_message(
build_slack_message_document(
"document_new", self.object))
except Exception:
logger.error("Could not send slack message for new document.")

self.object.save(notify=True)
register_event(self.request, EventType.EVENT_UPLOAD, self.object)

Expand Down
16 changes: 1 addition & 15 deletions geonode/maps/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -471,21 +471,7 @@ def map_remove(request, mapid, template='maps/map_remove.html'):
"map": map_obj
})
elif request.method == 'POST':
if getattr(settings, 'SLACK_ENABLED', False):
slack_message = None
try:
from geonode.contrib.slack.utils import build_slack_message_map
slack_message = build_slack_message_map("map_delete", map_obj)
except Exception:
logger.error("Could not build slack message for delete map.")
delete_map.apply_async((map_obj.id, ))
try:
from geonode.contrib.slack.utils import send_slack_messages
send_slack_messages(slack_message)
except Exception:
logger.error("Could not send slack message for delete map.")
else:
delete_map.apply_async((map_obj.id, ))
delete_map.apply_async((map_obj.id, ))

register_event(request, EventType.EVENT_REMOVE, map_obj)

Expand Down
1 change: 1 addition & 0 deletions src/django-geonode-mapstore-client
Submodule django-geonode-mapstore-client added at c5d68e

0 comments on commit 52340e4

Please sign in to comment.