Skip to content

Commit 5fab971

Browse files
committed
Resolved Travis CI and Hound CI errors
1 parent 7e205f9 commit 5fab971

File tree

6 files changed

+107
-15
lines changed

6 files changed

+107
-15
lines changed

oshc/main/migrations/0001_initial.py

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Generated by Django 1.11.2 on 2017-09-16 20:45
2+
# Generated by Django 1.11.2 on 2017-10-07 16:35
33
from __future__ import unicode_literals
44

55
from django.db import migrations, models
@@ -16,14 +16,37 @@ class Migration(migrations.Migration):
1616
migrations.CreateModel(
1717
name='chatSession',
1818
fields=[
19-
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
20-
('title', models.CharField(help_text='Session title', max_length=128)),
21-
('profile_name', models.CharField(help_text="The person's name", max_length=128)),
22-
('profile_url', models.URLField(help_text="The Url of the person's website")),
23-
('description', models.TextField(help_text='Session details', max_length=512)),
19+
('id', models.AutoField(auto_created=True,
20+
primary_key=True,
21+
serialize=False, verbose_name='ID')),
22+
('title', models.CharField(help_text='Session title',
23+
max_length=128)),
24+
('profile_name', models.CharField(
25+
help_text="The person's name", max_length=128)),
26+
('profile_url', models.URLField(
27+
help_text="The Url of the person's website")),
28+
('description', models.TextField(
29+
help_text='Session details', max_length=512)),
2430
('start_date', models.DateTimeField()),
2531
('end_date', models.DateTimeField()),
26-
('register_url', models.URLField(help_text='URL for the event registration')),
32+
('register_url', models.URLField(
33+
help_text='URL for the event registration')),
34+
],
35+
),
36+
migrations.CreateModel(
37+
name='Contest',
38+
fields=[
39+
('id', models.AutoField(auto_created=True,
40+
primary_key=True,
41+
serialize=False, verbose_name='ID')),
42+
('name', models.CharField(help_text='Contest name',
43+
max_length=128)),
44+
('link',
45+
models.URLField(help_text="URL of the contest's website")),
46+
('description', models.TextField(
47+
help_text='Contest details', max_length=512, null=True)),
48+
('start_date', models.DateField(null=True)),
49+
('end_date', models.DateField(null=True)),
2750
],
2851
),
2952
]

oshc/main/templates/403.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends 'base.html' %}
2+
{% load static %}
3+
{% block content %}
4+
<section class="main-section">
5+
<div class="container">
6+
<div class="jumbotron text-center">
7+
<h1>403</h1>
8+
<h4>Permission Denied. You don't have access to this file.</h4>
9+
<br />
10+
<a href="#" onClick="history.go(-1); return false;" class="btn btn-default">Go Back</a>
11+
</div>
12+
</div>
13+
</section>
14+
{% endblock %}

oshc/main/templates/404.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends 'base.html' %}
2+
{% load static %}
3+
{% block content %}
4+
<section class="main-section">
5+
<div class="container">
6+
<div class="jumbotron text-center">
7+
<h1>404</h1>
8+
<h4>Woops! Page not found.</h4>
9+
<br />
10+
<a href="#" onClick="history.go(-1); return false;" class="btn btn-default">Go Back</a>
11+
</div>
12+
</div>
13+
</section>
14+
{% endblock %}

oshc/main/templates/500.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% extends 'base.html' %}
2+
{% load static %}
3+
{% block content %}
4+
<section class="main-section">
5+
<div class="container">
6+
<div class="jumbotron text-center">
7+
<h1>500</h1>
8+
<h4>Internal Server Error.</h4>
9+
<br />
10+
<a href="#" onClick="history.go(-1); return false;" class="btn btn-default">Go Back</a>
11+
</div>
12+
</div>
13+
</section>
14+
{% endblock %}

oshc/main/templates/contests.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@
88
</div>
99
<h3>List of Upcoming Contests:</h3>
1010

11-
<ul>
1211
{% for contest in contest_list %}
13-
<li> <h4> <a href="{{contest.link}}">{{contest.name}}</a> </h4> </li>
14-
<strong>Start Date:</strong> {{contest.start_date}}<br>
15-
<strong>End Date:</strong> {{contest.end_date}}<br>
16-
<strong>Description:</strong> {{contest.description}}
17-
{% endfor %}
18-
</ul>
19-
12+
<div class="panel panel-default">
13+
<div class="panel-heading"><a href="{{contest.link}}">{{contest.name}}</a></div>
14+
<div class="panel-body">
15+
<strong>Start Date:</strong> {{contest.start_date}}<br>
16+
<strong>End Date:</strong> {{contest.end_date}}<br>
17+
<strong>Description:</strong> {{contest.description}}
18+
</div>
19+
</div>
20+
{% endfor %}
21+
2022
</div>
2123
</section>
2224
{% endblock %}

oshc/main/views.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55

66
from datetime import datetime
77

8+
from django.shortcuts import render_to_response
9+
10+
from django.template import RequestContext
11+
812

913
def home(request):
1014
session_list = chatSession.objects.order_by('start_date')[:3]
@@ -41,3 +45,24 @@ def add_contest(request):
4145
contest.save()
4246

4347
return HttpResponseRedirect("/contests/")
48+
49+
50+
def handler404(request):
51+
response = render_to_response('404.html', {},
52+
context_instance=RequestContext(request))
53+
response.status_code = 404
54+
return response
55+
56+
57+
def handler500(request):
58+
response = render_to_response('500.html', {},
59+
context_instance=RequestContext(request))
60+
response.status_code = 500
61+
return response
62+
63+
64+
def handler403(request):
65+
response = render_to_response('403.html', {},
66+
context_instance=RequestContext(request))
67+
response.status_code = 403
68+
return response

0 commit comments

Comments
 (0)