-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(map view): prevent client error when legend config is empty * Feature/pending datasets (#198) * Add pending_datasets table init and CRUD * Add approval_status and draft to metadata * Fix draft permissions * [main.yml] Init. pendingdb tables * Run WRI unit tests first * Fix paths in unit tests script * Run WRI unit tests first in src * Fix OR in unit tests script --------- Co-authored-by: Muhammad Ismail Shahzad <[email protected]> * Rm test.yml (#202) --------- Co-authored-by: Demenech <[email protected]> Co-authored-by: João Demenech <[email protected]> Co-authored-by: Michael Polidori <[email protected]> Co-authored-by: Muhammad Ismail Shahzad <[email protected]>
- Loading branch information
1 parent
bc33bf1
commit ef0e84a
Showing
23 changed files
with
897 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ckan-backend-dev/src/ckanext-wri/ckanext/wri/logic/action/delete.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
|
||
from ckan.types import Context, DataDict | ||
import ckan.plugins.toolkit as tk | ||
from ckan.common import _ | ||
|
||
from ckanext.wri.model.pending_datasets import PendingDatasets | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def pending_dataset_delete(context: Context, data_dict: DataDict): | ||
"""Delete a Pending Dataset""" | ||
package_id = data_dict.get("package_id") | ||
|
||
if not package_id: | ||
raise tk.ValidationError(_("package_id is required")) | ||
|
||
tk.check_access("pending_dataset_delete", context, data_dict) | ||
|
||
pending_dataset = None | ||
|
||
try: | ||
pending_dataset = PendingDatasets.delete(package_id) | ||
except Exception as e: | ||
log.error(e) | ||
raise tk.ValidationError(e) | ||
|
||
if not pending_dataset: | ||
raise tk.ValidationError(_(f"Pending Dataset not found: {package_id}")) | ||
|
||
return pending_dataset |
Oops, something went wrong.