Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Set the license for the ingredients

Roland Geider3898b6b08679
diff --git a/extras/scripts/create_ingredients_from_foodfacts.py b/extras/scripts/create_ingredients_from_foodfacts.py
index 859223adf..a641f23b6 100644
--- a/extras/scripts/create_ingredients_from_foodfacts.py
+++ b/extras/scripts/create_ingredients_from_foodfacts.py
@@ -172,6 +172,8 @@ for product in db.products.find({'lang': {"$in": langs}}):
'common_name': common_name,
'brand': brand,
'status': 2,
+ 'license_id': 5,
+ 'license_author': 'Open Food Facts',
}
try:
diff --git a/wger/core/fixtures/licenses.json b/wger/core/fixtures/licenses.json
index 8ee26d657..0cdbfb29c 100644
--- a/wger/core/fixtures/licenses.json
+++ b/wger/core/fixtures/licenses.json
@@ -1,38 +1,47 @@
[
{
- "pk": 1,
"model": "core.license",
+ "pk": 1,
"fields": {
- "url": "https://creativecommons.org/licenses/by-sa/3.0/deed.en",
"full_name": " Creative Commons Attribution Share Alike 3",
- "short_name": "CC-BY-SA 3"
+ "short_name": "CC-BY-SA 3",
+ "url": "https://creativecommons.org/licenses/by-sa/3.0/deed.en"
}
},
{
- "pk": 2,
"model": "core.license",
+ "pk": 2,
"fields": {
- "url": "https://creativecommons.org/licenses/by-sa/4.0/deed.en",
"full_name": "Creative Commons Attribution Share Alike 4",
- "short_name": "CC-BY-SA 4"
+ "short_name": "CC-BY-SA 4",
+ "url": "https://creativecommons.org/licenses/by-sa/4.0/deed.en"
}
},
{
- "pk": 3,
"model": "core.license",
+ "pk": 3,
"fields": {
- "url": "http://creativecommons.org/publicdomain/zero/1.0/",
"full_name": "Creative Commons Public Domain 1.0",
- "short_name": "CC0"
+ "short_name": "CC0",
+ "url": "http://creativecommons.org/publicdomain/zero/1.0/"
}
},
{
- "pk": 4,
"model": "core.license",
+ "pk": 4,
"fields": {
- "url": "http://creativecommons.org/licenses/by/4.0/",
"full_name": "Creative Commons Attribution 4",
- "short_name": "CC-BY 4"
+ "short_name": "CC-BY 4",
+ "url": "http://creativecommons.org/licenses/by/4.0/"
+ }
+ },
+ {
+ "model": "core.license",
+ "pk": 5,
+ "fields": {
+ "full_name": "Open Data Commons Open Database License",
+ "short_name": "ODbL",
+ "url": "https://opendatacommons.org/licenses/odbl/"
}
}
-]
+]
\ No newline at end of file