Describe the bug
When trying to set up persistent sharing I get this error here, when I insert the tag persistent_share_table in a template:
DoesNotExist at /targets/6/share/
ContentType matching query does not exist.
Request Method: GET
Request URL: http://localhost:8000/targets/6/share/
Django Version: 5.2.15
Exception Type: DoesNotExist
Exception Value:
ContentType matching query does not exist.
Exception Location: /usr/local/lib/python3.11/site-packages/django/db/models/query.py, line 635, in get
Raised during: tom_targets.views.TargetShareView
Python Executable: /usr/local/bin/python
Python Version: 3.11.15
Python Path:
['/galactic_science_opm',
'/usr/local/lib/python311.zip',
'/usr/local/lib/python3.11',
'/usr/local/lib/python3.11/lib-dynload',
'/usr/local/lib/python3.11/site-packages']
This is the function for the tag:
@register.inclusion_tag('tom_targets/partials/persistent_share_table.html', takes_context=True)
def persistent_share_table(context, target):
"""
Returns a partial for a table of persistent shares, used in persistent share management forms
"""
request = context['request']
persistentshares = get_objects_for_user(request.user, f'{Target._meta.app_label}.view_persistentshare')
if target:
persistentshares = persistentshares.filter(target__pk=target.pk)
can_delete = request.user.has_perm(f'{Target._meta.app_label}.delete_persistentshare')
return {'persistentshares': persistentshares, 'target': target, 'can_delete': can_delete}
And this is the line that causes the exception:
persistentshares = get_objects_for_user(request.user, f'{Target._meta.app_label}.view_persistentshare')
Could this have something to do with the fact that we use a custom target that extends BaseTarget?
Similar to this bug report(#1538) ?
To Reproduce
Steps to reproduce the behavior:
- Clone https://github.com/LSST-TVSSC/galactic-science-opm/tree/feature/78-share-data-to-MOP
- Add template tag
persistent_share_table to tom_targets/target_share.html
- Try sharing a target
- See error above.
Expected behavior
Setting up persistent sharing should be possible.
Additional context
This happens on tomtoolkit 3.0.0alpha12
Describe the bug
When trying to set up persistent sharing I get this error here, when I insert the tag
persistent_share_tablein a template:This is the function for the tag:
And this is the line that causes the exception:
Could this have something to do with the fact that we use a custom target that extends
BaseTarget?Similar to this bug report(#1538) ?
To Reproduce
Steps to reproduce the behavior:
persistent_share_tableto tom_targets/target_share.htmlExpected behavior
Setting up persistent sharing should be possible.
Additional context
This happens on tomtoolkit 3.0.0alpha12