Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
8c9978b
This doesn't work but google does
CodeMastr3 Apr 29, 2020
e36bfb9
Completed tasks #24, #28 (#36)
Asterisk007 Apr 6, 2020
825b976
Added profile page, technician sign-up, foreign-key relationships, an…
lcnorine Apr 12, 2020
ca7b24f
Fixes #46.
VioletInferno Apr 15, 2020
a195936
added view assignments page. Closes #40
lcnorine Apr 19, 2020
be78d99
Added view technicians page.
lcnorine Apr 21, 2020
643f192
Complete #43, start #44 (#52)
Asterisk007 Apr 26, 2020
f146a61
Added ability to edit location information along with functionality t…
VioletInferno Apr 27, 2020
b93ebd7
Delete database file.
VioletInferno Apr 27, 2020
70c9ea5
Added location as a 'keyword' option to search by in view_technicians.
VioletInferno Apr 27, 2020
6ca7d45
Fixes #51 and #56 by adding a validators for usernames and emails on …
VioletInferno Apr 27, 2020
c7ce636
Delete unnecessary migration file.
VioletInferno Apr 27, 2020
a692867
Remove unnecessary files.
VioletInferno Apr 27, 2020
2bcceea
Remove unnecessary files.
VioletInferno Apr 27, 2020
db514d0
Remove unnecessary files.
VioletInferno Apr 27, 2020
06f6164
Remove unnecessary files.
VioletInferno Apr 27, 2020
52ec10e
Remove unnecessary files.
VioletInferno Apr 27, 2020
2def571
Remove unnecessary files.
VioletInferno Apr 27, 2020
a9a1db5
Remove unnecessary files.
VioletInferno Apr 27, 2020
ed7891f
Delete __init__.cpython-37.pyc
VioletInferno Apr 27, 2020
754ec7a
Delete __init__.cpython-37.pyc
VioletInferno Apr 27, 2020
720c8e2
Delete settings.cpython-37.pyc
VioletInferno Apr 27, 2020
203429d
Delete urls.cpython-37.pyc
VioletInferno Apr 27, 2020
f5dff2a
Delete wsgi.cpython-37.pyc
VioletInferno Apr 27, 2020
e562da1
Added links to user accounts. Added rating system for technicians.
lcnorine Apr 28, 2020
ff482d4
Closes #42. Closes #41. Adds ability to edit tickets and to resolve &…
VioletInferno Apr 29, 2020
29bc3aa
Delete 0001_initial.py
VioletInferno Apr 29, 2020
737edae
Delete 0002_auto_20200428_2145.py
VioletInferno Apr 29, 2020
92f8f42
Closes #58. Re-opens #51. Need an alternative solution for validation.
VioletInferno Apr 29, 2020
af278ff
Closes #58. Re-opens #51. Need an alternative solution for validation.
VioletInferno Apr 29, 2020
8f5cd49
Merge branch 'master' of https://github.com/CodeMastr3/ODIT
CodeMastr3 Apr 29, 2020
c0be93e
Updated db.sqlite3
CodeMastr3 Apr 29, 2020
d367f06
Don't delete the database file
CodeMastr3 May 4, 2020
2592cdf
Finalized google log in
CodeMastr3 May 4, 2020
80a1eb6
Removed database file
CodeMastr3 May 4, 2020
7013b01
Merge branch 'master' into master
CodeMastr3 May 4, 2020
e301f92
Added sqlite to gitignore and added comment to login.html
CodeMastr3 May 4, 2020
37b9f50
Updated to not merge conflict?
CodeMastr3 May 4, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,5 @@ venv.bak/
!.vscode/launch.json
!.vscode/extensions.json
.history
db.sqlite3
*.sqlite3
Binary file added db.sqlite3
Binary file not shown.
1 change: 1 addition & 0 deletions myapp/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def must_be_unique_user(value):
('Other', 'Other')
]
class IssueForm(forms.Form):

title = forms.CharField(
widget = forms.TextInput(
attrs={'class': 'form-control'}
Expand Down
Empty file removed myapp/migrations/__init__.py
Empty file.
23 changes: 22 additions & 1 deletion myapp/templates/registration/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,25 @@ <h3 class="text-center">Log in</h3>
</div>
</div>

{% endblock %}
{% load socialaccount %}
<html>
<head>
<title>Google Registration</title>
</head>
<body>
<!-- I believe that this is if a user wants to connect their account to google -->
<h1>My Google Login Project</h1>
{% if user.is_authenticated %}
<p>Welcome, {{ user.username }} !</p>

{% else %}
<h1>My Google Login Project</h1>
<a href="{% provider_login_url 'google' %}">Login with Google</a>
{% endif %}

</body>
</html>


{% endblock %}

5 changes: 2 additions & 3 deletions myapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def submit(request):
@login_required
def viewissues(request):
if request.method == "POST":
form = forms.IssueFilter(request.POST)
form = forms.IssueFilter(data=request.POST, request=request)
if form.is_valid():
issues_list = models.Issue_Model.objects.all()
if (form.cleaned_data['keyword']):
Expand All @@ -57,7 +57,7 @@ def viewissues(request):
Q(issue_type__exact=form.cleaned_data['issue_type'])
)
else:
form = forms.IssueFilter()
form = forms.IssueFilter(request=request)
issues_list = models.Issue_Model.objects.all()
else:
form = forms.IssueFilter()
Expand Down Expand Up @@ -348,4 +348,3 @@ def edit_ticket(request, id):
return render(request, "editticket.html", context=context)
else:
return redirect("/viewmysubmittedissues.html")

37 changes: 34 additions & 3 deletions mysite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
https://docs.djangoproject.com/en/3.0/ref/settings/
"""

# https://www.youtube.com/watch?v=ZTBexYIIOP8

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
Expand All @@ -35,11 +37,17 @@
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.contenttypes',
'django.contrib.sites',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'myapp'#,
'myapp',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.google',

#'crispy_forms'
]

Expand Down Expand Up @@ -122,4 +130,27 @@
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'
#CRISPY_TEMPLATE_PACK = 'bootstrap4'

# Django allauth settings
AUTHENTICATION_BACKENDS = (
# Needed to login by username in Django admin, regardless of 'allauth'
'django.contrib.auth.backends.ModelBackend',

# 'allauth' specific authenication methods, such as login by email
'allauth.account.auth_backends.AuthenticationBackend',
)

SITE_ID = 1

SOCIALACCOUNT_PROVIDERS = {
'google': {
'SCOPE': [
'profile',
'email',
],
'AUTH_PARAMS': {
'access_type': 'online',
}
}
}
#CRISPY_TEMPLATE_PACK = 'bootstrap4'
3 changes: 3 additions & 0 deletions mysite/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@
1. Import the include() function: from django.urls import include, path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.urls import path, include
from django.views.generic import TemplateView

import myapp

urlpatterns = [
path('admin/', admin.site.urls),
path('accounts/', include('allauth.urls')),
path('', include('myapp.urls') ),
]