Skip to content

Commit

Permalink
bayanat v1.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sjacgit committed Aug 3, 2021
1 parent 9b7e219 commit d8d2e77
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions enferno/admin/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def dashboard():

# Labels routes
@admin.route('/labels/')
@roles_accepted('Admin', 'Mod')
def labels():
"""
Endpoint to render the labels backend page.
Expand All @@ -112,7 +113,6 @@ def labels():


@admin.route('/api/labels/')
@roles_accepted('Admin', 'Mod')
def api_labels():
"""
API endpoint feed and filter labels with paging
Expand Down Expand Up @@ -207,7 +207,7 @@ def api_label_update(id):


@admin.route('/api/label/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_label_delete(id):
"""
Endpoint to delete a label.
Expand All @@ -223,7 +223,7 @@ def api_label_delete(id):


@admin.route('/api/label/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_label_import():
"""
Endpoint to import labels via CSV
Expand All @@ -238,6 +238,7 @@ def api_label_import():

# EventType routes
@admin.route('/eventtypes/')
@roles_accepted('Admin', 'Mod')
def eventtypes():
"""
Endpoint to render event types backend
Expand Down Expand Up @@ -312,7 +313,7 @@ def api_eventtype_update(id):


@admin.route('/api/eventtype/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_eventtype_delete(id):
"""
Endpoint to delete an event type
Expand All @@ -328,7 +329,7 @@ def api_eventtype_delete(id):


@admin.route('/api/eventtype/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_eventtype_import():
"""
Endpoint to bulk import event types from a CSV file
Expand Down Expand Up @@ -399,7 +400,7 @@ def api_potentialviolation_update(id):


@admin.route('/api/potentialviolation/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_potentialviolation_delete(id):
"""
Endpoint to delete a potential violation
Expand All @@ -415,7 +416,7 @@ def api_potentialviolation_delete(id):


@admin.route('/api/potentialviolation/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_potentialviolation_import():
"""
Endpoint to import potential violations from csv file
Expand Down Expand Up @@ -486,7 +487,7 @@ def api_claimedviolation_update(id):


@admin.route('/api/claimedviolation/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_claimedviolation_delete(id):
"""
Endpoint to delete a claimed violation
Expand All @@ -500,7 +501,7 @@ def api_claimedviolation_delete(id):


@admin.route('/api/claimedviolation/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_claimedviolation_import():
"""
Endpoint to import claimed violations from a CSV file
Expand All @@ -515,6 +516,7 @@ def api_claimedviolation_import():

# Sources routes
@admin.route('/sources/')
@roles_accepted('Admin', 'Mod')
def sources():
"""
Endpoint to render sources backend page
Expand Down Expand Up @@ -601,7 +603,7 @@ def api_source_update(id):


@admin.route('/api/source/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_source_delete(id):
"""
Endopint to delete a source item
Expand All @@ -615,7 +617,7 @@ def api_source_delete(id):


@admin.route('/api/source/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_source_import():
"""
Endpoint to import sources from CSV data
Expand All @@ -638,7 +640,6 @@ def locations():


@admin.route('/api/locations/')
@roles_accepted('Admin', 'Mod')
def api_locations():
"""Returns locations in JSON format, allows search and paging."""
query = []
Expand Down Expand Up @@ -704,7 +705,7 @@ def api_location_update(id):


@admin.route('/api/location/<int:id>', methods=['DELETE'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_location_delete(id):
"""Endpoint for deleting locations. """

Expand All @@ -715,7 +716,7 @@ def api_location_delete(id):


@admin.route('/api/location/import/', methods=['POST'])
@roles_accepted('Admin', 'Mod')
@roles_required('Admin')
def api_location_import():
"""Endpoint for importing locations."""
if 'csv' in request.files:
Expand Down Expand Up @@ -937,7 +938,7 @@ def api_bulletin_get(id):


@admin.route('/api/bulletin/import/', methods=['POST'])
@roles_accepted('Admin','DA')
@roles_required('Admin')
def api_bulletin_import():
"""
Endpoint to import bulletins from csv data
Expand Down Expand Up @@ -1757,7 +1758,7 @@ def api_incident_get(id):


@admin.route('/api/incident/import/', methods=['POST'])
@roles_accepted('Admin','DA')
@roles_required('Admin')
def api_incident_import():
"""
Endpoint to handle incident imports.
Expand Down

0 comments on commit d8d2e77

Please sign in to comment.