forked from 0x2620/pandora
add default itemKey value support, add license as default value to pad.ma. fixes #1180
This commit is contained in:
parent
80e9569595
commit
18d9c93fff
2 changed files with 9 additions and 1 deletions
|
@ -454,7 +454,11 @@
|
|||
"type": ["string"],
|
||||
"columnWidth": 120,
|
||||
"filter": true,
|
||||
"sort": true
|
||||
"sort": true,
|
||||
"default": [
|
||||
"Creative Commons Attribution-ShareAlike 3.0 License",
|
||||
"Pad.ma General Public License"
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "rightslevel",
|
||||
|
|
|
@ -112,6 +112,10 @@ def get_item(info, user=None, async=False):
|
|||
item = Item()
|
||||
item.user = user
|
||||
item.data = item_data
|
||||
#set default values
|
||||
for k in settings.CONFIG['itemKeys']:
|
||||
if 'default' in k:
|
||||
item.data[k['id']] = default_data[k['default']]
|
||||
item.itemId = info.get('oxdbId', item.oxdb_id())
|
||||
try:
|
||||
existing_item = Item.objects.get(oxdbId=item.oxdb_id())
|
||||
|
|
Loading…
Reference in a new issue