mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix permission parser
This commit is contained in:
parent
6dead88028
commit
3e3da8b2d1
@ -279,13 +279,13 @@ class RuleSet(models.Model):
|
||||
|
||||
def split_model(model):
|
||||
"""get modelname and app from modelstring"""
|
||||
app, *model = model.split('_')
|
||||
*app, model = model.split('_')
|
||||
|
||||
# handle models that have
|
||||
if len(model) > 1:
|
||||
model = '_'.join(model)
|
||||
if len(app) > 1:
|
||||
app = '_'.join(app)
|
||||
else:
|
||||
model = model[0]
|
||||
app = app[0]
|
||||
|
||||
return model, app
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user