Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed bug related to removing title argument for uploading data #22

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions geonodectl
Original file line number Diff line number Diff line change
Expand Up @@ -266,12 +266,7 @@ To use this tool you have to set the following environment variables before star
required=True,
help="file to upload",
)
documents_upload.add_argument(
"-t", "--title", type=str, dest="title", required=True, help="document title"
)
documents_upload.add_argument(
"-a", "--abstract", type=str, dest="abstract", help="docment abstract"
)

documents_upload.add_argument(
"--metadata-only",
action="store_true",
Expand Down
4 changes: 0 additions & 4 deletions src/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class GeonodeDatasetsHandler(GeonodeResourceHandler):

def cmd_upload(
self,
title: str,
file_path: Path,
charset: str = "UTF-8",
time: bool = False,
Expand All @@ -38,14 +37,12 @@ def cmd_upload(
"""upload data and show them on the cmdline

Args:
title (str): title of the new dataset
file_path (Path): Path to the file to upload.
charset (str, optional): charset of data Defaults to "UTF-8".
time (bool, optional): set if data is timeseries data Defaults to False.
mosaic (bool, optional): declare dataset as mosaic
"""
r = self.upload(
title=title,
file_path=file_path,
charset=charset,
time=time,
Expand Down Expand Up @@ -85,7 +82,6 @@ def upload(
Args:
file_path (Path): Path to the file to upload. If shape make sure to set
the shp file and add place other files with same name next to the given
title (str): title of the new dataset
charset (str, optional): Fileencoding Defaults to "UTF-8".
time (bool, optional): True if the dataset is a timeseries dataset. Defaults to False.
mosaic (bool, optional): declare dataset as mosaic
Expand Down
12 changes: 1 addition & 11 deletions src/documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ class GeonodeDocumentsHandler(GeonodeResourceHandler):

def cmd_upload(
self,
title: str,
file_path: Path,
metadata_only: bool = False,
charset: str = "UTF-8",
Expand All @@ -35,17 +34,12 @@ def cmd_upload(
"""upload data and show them on the cmdline

Args:
title (str): title of the new dataset
file_path (Path): Path to the file to upload.
charset (str, optional): charset of data Defaults to "UTF-8".
metadata_only (bool, optional): set upload as metadata_only
"""
r = self.upload(
title=title,
file_path=file_path,
metadata_only=metadata_only,
charset=charset,
**kwargs
file_path=file_path, metadata_only=metadata_only, charset=charset, **kwargs
)
list_items = [
["name", r["title"]],
Expand All @@ -63,7 +57,6 @@ def cmd_upload(

def upload(
self,
title: str,
file_path: Path,
charset: str = "UTF-8",
metadata_only: bool = False,
Expand All @@ -72,7 +65,6 @@ def upload(
"""upload a document to geonode

Args:
title (str): title of the document
file_path (Path): file to upload
charset (str, optional): charset. Defaults to "UTF-8".
metadata_only (bool, optional): set upload as metadata_only. Defaults to False.
Expand All @@ -91,8 +83,6 @@ def upload(
params = {
# layer permissions
"permissions": '{ "users": {"AnonymousUser": ["view_resourcebase"]} , "groups":{}}',
"title": title,
"abstract": kwargs["abstract"] if "abstract" in kwargs else "",
"charset": charset,
"metadata_only": metadata_only,
}
Expand Down