Further tweaks

This commit is contained in:
Oliver 2021-06-23 21:40:09 +10:00
parent b8a3117c83
commit 2c1db2a902
2 changed files with 4 additions and 3 deletions

View File

@ -60,11 +60,11 @@ class InvenTreeMetadata(SimpleMetadata):
del actions[method] del actions[method]
# Add a 'DELETE' action if we are allowed to delete # Add a 'DELETE' action if we are allowed to delete
if check(user, table, 'delete'): if 'DELETE' in view.allowed_methods and check(user, table, 'delete'):
actions['DELETE'] = True actions['DELETE'] = True
# Add a 'VIEW' action if we are allowed to view # Add a 'VIEW' action if we are allowed to view
if check(user, table, 'view'): if 'GET' in view.allowed_methods and check(user, table, 'view'):
actions['GET'] = True actions['GET'] = True
except AttributeError: except AttributeError:

View File

@ -186,8 +186,9 @@ class APITests(InvenTreeAPITestCase):
actions = self.getActions(url) actions = self.getActions(url)
self.assertEqual(len(actions), 2)
self.assertIn('POST', actions) self.assertIn('POST', actions)
self.assertEqual(len(actions), 1) self.assertIn('GET', actions)
def test_detail_endpoint_actions(self): def test_detail_endpoint_actions(self):
""" """