SciPost Code Repository

Skip to content
Snippets Groups Projects
utils.py 217 B
Newer Older
__copyright__ = "Copyright 2016-2018, Stichting SciPost (SciPost Foundation)"
__license__ = "AGPL v3"


Jorran de Wit's avatar
Jorran de Wit committed

def id_to_slug(id):
    return max(0, int(id) + 821)


def slug_to_id(slug):
    return max(0, int(slug) - 821)