Implement some suggestions from the Doctor

This commit is contained in:
2023-05-20 17:02:33 +01:00
parent 0b22669a29
commit 90ae87b1b2
12 changed files with 39 additions and 33 deletions

View File

@@ -30,15 +30,15 @@ for app in [apps.get_app_config(label) for label in ("RIGS", "assets", "training
modelname = model.__name__.lower()
if appname == 'rigboard':
urlpatterns += [
path('{}/<str:pk>/history/'.format(modelname),
permission_required_with_403('{}.change_{}'.format(app.label, modelname))(
path(f'{modelname}/<str:pk>/history/',
permission_required_with_403(f'{app.label}.change_{modelname}')(
views.VersionHistory.as_view()),
name='{}_history'.format(modelname), kwargs={'model': model, 'app': appname, }),
name=f'{modelname}_history', kwargs={'model': model, 'app': appname, }),
]
else:
urlpatterns += [
path('{}/{}/<str:pk>/history/'.format(appname, modelname),
permission_required_with_403('{}.change_{}'.format(app.label, modelname))(
path(f'{appname}/{modelname}/<str:pk>/history/',
permission_required_with_403('{app.label}.change_{modelname}')(
views.VersionHistory.as_view()),
name='{}_history'.format(modelname), kwargs={'model': model, 'app': appname, }),
name=f'{modelname}_history', kwargs={'model': model, 'app': appname, }),
]