-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add / and /robots.txt functionality after removing it when deleting cms.
- Loading branch information
1 parent
724e048
commit 7b01951
Showing
6 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
from .home import Home | ||
from .no_robots import no_robots | ||
from .submission_progress_view import ( # noqa | ||
SubmissionProgressView, | ||
submission_progress_check, | ||
) | ||
from .tribal_data_consent import TribalDataConsent | ||
|
||
from .upload_report_view import UploadReportView | ||
|
||
from .unlock_after_certification import UnlockAfterCertificationView | ||
|
||
# In case we want to iterate through all the views for some reason: | ||
views = [ | ||
Home, | ||
SubmissionProgressView, | ||
TribalDataConsent, | ||
UnlockAfterCertificationView, | ||
UploadReportView, | ||
no_robots, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from django.views import generic | ||
from django.shortcuts import render, redirect | ||
from django.urls import reverse | ||
|
||
|
||
# class based views for posts | ||
class Home(generic.View): | ||
""" | ||
This is for the root path: / | ||
It will return the home template if not authenticated and the audit table if | ||
authenticated. | ||
""" | ||
|
||
def get(self, request, *args, **kwargs): | ||
if request.user.is_authenticated: | ||
url = reverse("audit:MySubmissions") | ||
return redirect(url) | ||
template_name = "home.html" | ||
extra_context = {} | ||
return render(request, template_name, extra_context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.http import HttpResponse | ||
|
||
|
||
def no_robots(_context): | ||
""" | ||
Return Disallow for * | ||
""" | ||
content = "User-agent: *\nDisallow: /" | ||
return HttpResponse(content, content_type="text/plain") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters