Skip to content

Commit

Permalink
Merge pull request #9 from hifis-net/4-imprint
Browse files Browse the repository at this point in the history
Adds imprint migration
  • Loading branch information
cmeessen authored Jul 26, 2022
2 parents 481949f + d18abc8 commit 2873a1a
Show file tree
Hide file tree
Showing 2 changed files with 103 additions and 0 deletions.
26 changes: 26 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,39 @@ async def add_research_field(client, spotlight):
logging.info(res.data)


async def process_imprint(client):
filename ="./resources/Imprint.md"
with open(filename, "r") as imprint:
logging.info("Processing imprint from %s", filename)

data = {
"slug": "imprint",
"title": "Imprint",
"description": imprint.read(),
"is_published": True,
"position": 1,
}

db_imprint = await client.from_("meta_pages").select("*").eq("slug","imprint").execute()

if (len(db_imprint.data) > 0):
logging.info("Imprint already exsits. Updating.")
res = await client.from_("meta_pages").update(data).execute()
else:
logging.info("Imprint not found. Creating.")
res = await client.from_("meta_pages").insert(data).execute()

logging.info(res.data)


async def main():
token = jwt.encode(JWT_PAYLOAD, PGRST_JWT_SECRET, algorithm=JWT_ALGORITHM)
spotlights = get_spotlights()
skipped = []

async with AsyncPostgrestClient(POSTGREST_URL) as client:
client.auth(token=token)
await process_imprint(client)

for spot in spotlights:
# check if spotlight matches our criteria
Expand Down
77 changes: 77 additions & 0 deletions resources/Imprint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Imprint

Imprint according to § 5 TMG (Tele Media Act) and § 55 RStV (German Interstate Treaty on Broadcasting).

## Provider

The provider of the internet presence helmholtz.software is the Helmholtz Centre Potsdam German Research Centre for Geosciences.

This internet presence was developed within the HIFIS incubator of the Helmholtz Association of German Research Centres.

## Address

Helmholtz Centre Potsdam German Research Centre for Geosciences - GFZ
Telegrafenberg
14473 Potsdam, Germany
Tel.: +49 331 288 0
Website: www.gfz-potsdam.de

## Legal form

The Helmholtz Centre Potsdam German Research Centre for Geosciences - GFZ is a Public Law Foundation. The GFZ is member of the Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V. (Helmholtz Association of German Research Centres).

## Authorised representatives

The GFZ is legally represented by Prof. Dr. Susanne Buiter (Chairwoman of the Board and Scientific Executive Director, interim) and Dr. Stefan Schwartze (Administrative Executive Director).

## Value added tax ID

VAT Identification Number according to § 27a VAT Tax Act: DE138407750

## Editorial staff

Responsible editor for the contents of this internet presence with regard to media law is:
Martin Hammitzsch (Head of eScience-Centre)
Tel.: +49 331 288-1717
E-Mail: [email protected]

Editor, concept, coordination (helmholtz.software)
Dr. Christian Meeßen
Tel.: +49 331 288-1983
E-Mail: [email protected]

## Copyright

This page includes content licensed under [Pexels License](https://www.pexels.com/license/), [Unsplash License](https://unsplash.com/license) and [CC0-1.0](https://creativecommons.org/share-your-work/public-domain/cc0/) from the following creators:

* CC0-1.0
* Pixabay
* Pexels License
* Aleksejs Bergmanis
* Anna Tarazevich
* Blue Ox Studio
* Cottonbro
* Markus Spiske
* RF._.studio
* Unsplash License
* Yulia Buchatskaya
* JJ Ying

If not stated otherwise, the texts and images on this website are protected by copyright. Copying these files or printing the publications is only permitted for private use.

All other uses, such as duplication, alteration or use of these graphics, recordings, video sequences or texts on this websites in further electronic or printed publications for non-commercial and commercial purposes are not permitted without the explicit consent of the copyright holder - even if they are not labelled as a copyright protected document.

Content, which is published under the Creative Commons License may be used only in accordance with the specified license conditions.

<!-- Certain data products on this portal originate from other sources. If you would like to make use of these data, please contact the data owner concerning licensing terms or see terms of use on the corresponding web pages. -->

## Liability notice

The editorial staff controls and updates the available information on this website at regular intervals. Despite all care, information, data or links may have changed in the meantime. There is no liability or guarantee for the currentness, accuracy and completeness of the information provided.

The same applies to all other websites, which are referred to by hyperlink. There is not responsibility for the content of the websites that are reached as a result of such a connection. Instead the relevant provider is always responsible for the contents of the linked pages.

In establishing the initial link, the editorial staff has reviewed the relevant external content in order to determine that they were free of illegal content at the time of linking.

If you detect errors in content or technology, please let us know.

0 comments on commit 2873a1a

Please sign in to comment.