Small fix

This commit is contained in:
ferdzo
2024-03-15 01:12:06 +01:00
parent 90fb3b6438
commit 864ebec45a
2 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View File

@@ -8,6 +8,7 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
.idea/
# User-specific stuff # User-specific stuff
.idea/**/workspace.xml .idea/**/workspace.xml
.idea/**/tasks.xml .idea/**/tasks.xml

View File

@@ -10,8 +10,11 @@ from django_tables2 import SingleTableView
# from django.template import loader # from django.template import loader
def index(request): def index(request):
if request.user.is_authenticated:
proba = Insert.objects.order_by("date") proba = Insert.objects.order_by("date")
return HttpResponse(proba) return HttpResponse(proba)
else:
return HttpResponse("You are not logged in")
# def detail(request,question_id): # def detail(request,question_id):
@@ -21,7 +24,7 @@ def index(request):
# #
class ReportById(generic.DetailView): class ReportById(generic.DetailView):
model = Insert model = Insert
template_name = "serviceCRM/python.exe -m pip install --upgrade pipid.html" template_name = "serviceCRM/id.html"
def ReportById(request, question_id): def ReportById(request, question_id):
req = get_object_or_404(Insert, id=question_id) req = get_object_or_404(Insert, id=question_id)