Skip to content

Commit

Permalink
Merge pull request #22 from GeoNodeUserGroup-DE/bugfix_title_and_abst…
Browse files Browse the repository at this point in the history
…ract

fixed bug related to removing title argument for uploading data
  • Loading branch information
mwallschlaeger authored Aug 23, 2023
2 parents 955fdcd + a605ac8 commit 2c48c08
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 21 deletions.
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

0 comments on commit 2c48c08

Please sign in to comment.