PEP8
This commit is contained in:
parent
a8e531045c
commit
a0191b6dc2
|
@ -13,5 +13,5 @@ def backup_view_permission(old_fuction):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this device."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -10,4 +10,4 @@ urlpatterns = [
|
|||
views.BackupCreateView.as_view(), name='backup_create'),
|
||||
path('delete/backup/<int:pk>/',
|
||||
views.BackupDeleteView.as_view(), name='backup_delete'),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -64,5 +64,3 @@ class BackupDeleteView(LoginRequiredMixin, DeleteView):
|
|||
|
||||
def get_success_url(self):
|
||||
return reverse('computer', args=(self.object.computer.pk,))
|
||||
|
||||
|
||||
|
|
|
@ -13,5 +13,5 @@ def computer_view_permission(old_fuction):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this device."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -94,4 +94,3 @@ class ComputerGpuRelation(models.Model):
|
|||
|
||||
class Meta:
|
||||
verbose_name_plural = "GPUs in Computer"
|
||||
|
||||
|
|
|
@ -94,5 +94,3 @@ def test_computer_detail_view_gpu_relation(create_admin_user):
|
|||
response = client.get('/computer/' + str(computer.id) + '/')
|
||||
assert (response.status_code == 200
|
||||
and helper.in_content(response, gpu))
|
||||
|
||||
|
||||
|
|
|
@ -54,4 +54,4 @@ urlpatterns = [
|
|||
name='raid_create'),
|
||||
path('delete/raid/<int:pk>/', views.RaidDeleteView.as_view(),
|
||||
name='raid_delete'),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -301,5 +301,3 @@ class RaidDeleteView(LoginRequiredMixin, DeleteView):
|
|||
|
||||
def get_success_url(self):
|
||||
return reverse('computer', args=(self.object.computer.pk,))
|
||||
|
||||
|
||||
|
|
|
@ -4,4 +4,4 @@ from django.urls import path, include
|
|||
urlpatterns = [
|
||||
# required for the login functionality
|
||||
path('accounts/', include('django.contrib.auth.urls')),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -12,5 +12,5 @@ def customer_view_permission(old_function):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this page."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -9,4 +9,4 @@ urlpatterns = [
|
|||
path('create/customer/',
|
||||
views.CustomerCreateView.as_view(),
|
||||
name='customer_create'),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -13,5 +13,5 @@ def device_view_permission(old_function):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this device."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -11,4 +11,4 @@ urlpatterns = [
|
|||
path('delete/license-with-computer/<int:pk>/',
|
||||
views.LicenseWithComputerDeleteView.as_view(),
|
||||
name='license_with_computer_delete'),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -59,5 +59,3 @@ class LicenseWithComputerDeleteView(LoginRequiredMixin, DeleteView):
|
|||
|
||||
def get_success_url(self):
|
||||
return reverse('computer', args=(self.object.computer.pk,))
|
||||
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ import os
|
|||
import sys
|
||||
|
||||
if __name__ == "__main__":
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "network_inventory.settings")
|
||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
|
||||
"network_inventory.settings")
|
||||
try:
|
||||
from django.core.management import execute_from_command_line
|
||||
except ImportError as exc:
|
||||
|
|
|
@ -13,5 +13,5 @@ def net_view_permission(old_fuction):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this device."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -6,4 +6,4 @@ urlpatterns = [
|
|||
path('customer/<int:pk>/nets/', views.nets_table_view,
|
||||
name='nets'),
|
||||
path('net/<int:pk>/', views.net_detail_view, name='net'),
|
||||
]
|
||||
]
|
||||
|
|
|
@ -100,7 +100,7 @@ AUTH_PASSWORD_VALIDATORS = [
|
|||
]
|
||||
|
||||
AUTHENTICATION_BACKENDS = (
|
||||
'django.contrib.auth.backends.ModelBackend', # this is default
|
||||
'django.contrib.auth.backends.ModelBackend', # this is default
|
||||
'guardian.backends.ObjectPermissionBackend',
|
||||
)
|
||||
|
||||
|
|
|
@ -12,8 +12,8 @@ SECRET_KEY = 'development_key'
|
|||
DEBUG = True
|
||||
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': ':memory:',
|
||||
}
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.sqlite3',
|
||||
'NAME': ':memory:',
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,3 @@ DATABASES = {
|
|||
'PORT': 5432,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,5 +13,5 @@ def user_view_permission(old_fuction):
|
|||
else:
|
||||
return HttpResponseForbidden(
|
||||
"You're not allowed to access this device."
|
||||
)
|
||||
)
|
||||
return new_function
|
||||
|
|
|
@ -6,4 +6,4 @@ urlpatterns = [
|
|||
path('customer/<int:pk>/users/', views.users_table_view,
|
||||
name='users'),
|
||||
path('user/<int:pk>/', views.user_detail_view, name='user'),
|
||||
]
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue