Skip to content

Commit 90582d9

Browse files
committed
❌ remove code
1 parent 6369335 commit 90582d9

6 files changed

Lines changed: 12 additions & 17 deletions

File tree

api/admin.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

api/models.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

api/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from django.http import HttpResponse
22
from rest_framework.renderers import JSONRenderer
33
from rest_framework.decorators import api_view, permission_classes
4-
from rest_framework.response import Response
54
from rest_framework import status
65
from .serializers import tutorialSerializer, tagSerializer, tutorialPOST
76
from django.shortcuts import render
@@ -96,4 +95,5 @@ def tutorials(request):
9695
tagObjList = tag.objects.filter(name__in = tags)
9796
tutorialObject.tags.set(tagObjList)
9897
return JSONResponse({"message " : "Created, Thanks" }, status=status.HTTP_201_CREATED)
98+
return JSONResponse({"message " : "Created, Thanks" }, status=status.HTTP_201_CREATED)
9999
return JSONResponse({"message":"Not Valid, Try Again"}, status=status.HTTP_406_NOT_ACCEPTABLE)

app/templates/contribute.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{% extends 'base.html' %}
22
{% load staticfiles %}
33
{% block content %}
4+
45
<section class="hero is-medium is-primary is-bold">
56
<div class="hero-body">
67
<div class="container">
@@ -14,7 +15,7 @@ <h1 class="title" align="center">
1415
</div>
1516
</section>
1617

17-
<section class="hero is-medium is-success is-bold">
18+
<section class="hero is-medium is-dark is-bold">
1819
<div class="hero-body">
1920
<div class="container">
2021
<h1 class="title" align="center">Or just,<br>
@@ -27,6 +28,9 @@ <h1 class="title" align="center">Or just,<br>
2728
</section>
2829
<section class="hero is-medium is-primary is-bold">
2930
<div class="hero-body">
31+
{% if error %}
32+
<h2 class="title is-3"><i>{{ error }}</i></h2>
33+
{% endif %}
3034
<div class="container">
3135
<form action="/thankyou/" method="post">
3236
{% csrf_token %}

app/templates/search_results.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ <h3 class="subtitle">Search Results for "{{ tquery }}"</h3>
5353
</div>
5454

5555
{% else %}
56-
<h2 class="subtitle notification is-primary" align="center">
57-
<img src="{% static 'app/search404.svg' %}" height="100" width="100">
58-
<br> Ah! Sorry, No Results 🙀
56+
<h2 class="subtitle notification is-primary title is-3" align="center">
57+
Ah! Sorry, No Results<br>
58+
<img src="{% static 'app/search404.svg' %}" height="160" width="160">
5959
</h2>
6060
{% endif %}
6161

app/views.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
from django.views.generic import TemplateView, ListView, FormView
1+
from django.views.generic import TemplateView
22
from django.shortcuts import render
3-
from django.http import HttpResponse
43
from django.db.models import Q
5-
from django.contrib import messages
64
from . models import tag, tutorial
7-
import re
85
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
96
from taggie.parser import generateTags
107

@@ -53,7 +50,7 @@ def post(self, request):
5350
if linkCount == 0:
5451
tags, title = generateTags(request.POST['tlink'])
5552
if 'other' in tags:
56-
pass
53+
return render(request, 'contribute.html', {'error': "Not a Tutorial Link, Try Again"})
5754
else:
5855
tutorialObject = tutorial.objects.create(
5956
title = title,
@@ -66,7 +63,7 @@ def post(self, request):
6663
tagObjList = tag.objects.filter(name__in = tags)
6764
tutorialObject.tags.set(tagObjList)
6865
return render(request, 'thankyou.html')
69-
return render(request, 'contribute.html')
66+
return render(request, 'thankyou.html')
7067

7168

7269
def tags(request):

0 commit comments

Comments
 (0)