Merge branch 'prod' of git.frat.tech:aaron/fincom into prod
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from django.contrib import admin
|
||||
from models import Committee
|
||||
|
||||
from committee.models import Committee
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Committee)
|
||||
|
||||
@@ -5,7 +5,7 @@ from django.db import models
|
||||
|
||||
class Committee(models.Model):
|
||||
name = models.CharField(max_length=100, unique=True)
|
||||
chair = models.ForeignKey(User, null=True)
|
||||
chair = models.ForeignKey(User, null=True, on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
from django.conf.urls import url
|
||||
from . import views
|
||||
from django.urls import path
|
||||
|
||||
from committee import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.edit, name='edit'),
|
||||
url(r'^update/(?P<committee>\d+)/$', views.update, name='update'),
|
||||
url(r'^fincom/$', views.add_to_fincom, name='add_to_fincom'),
|
||||
url(r'^fincom/delete$', views.remove_fincom, name='remove_fincom'),
|
||||
url(r'^new$', views.new_committee, name='new_committee'),
|
||||
path('', views.edit, name='edit'),
|
||||
path('update/<int:committee>/', views.update, name='update'),
|
||||
path('fincom/', views.add_to_fincom, name='add_to_fincom'),
|
||||
path('fincom/delete', views.remove_fincom, name='remove_fincom'),
|
||||
path('new', views.new_committee, name='new_committee'),
|
||||
]
|
||||
|
||||
@@ -2,7 +2,8 @@ from django.shortcuts import HttpResponse, HttpResponseRedirect
|
||||
from django.template import loader
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.contrib.auth.models import User, Group
|
||||
from models import Committee
|
||||
|
||||
from committee.models import Committee
|
||||
|
||||
@login_required
|
||||
def edit(request):
|
||||
@@ -68,4 +69,4 @@ def remove_fincom(request):
|
||||
user.groups.remove(Group.objects.filter(name='Fincom')[0])
|
||||
user.save()
|
||||
|
||||
return HttpResponseRedirect('/committees')
|
||||
return HttpResponseRedirect('/committees')
|
||||
|
||||
@@ -28,7 +28,7 @@ DEBUG = False
|
||||
|
||||
ALLOWED_HOSTS = [
|
||||
'localhost',
|
||||
'dtd-fincom.herokuapp.com',
|
||||
'fincom.frat.tech',
|
||||
'fincom.delt.space',
|
||||
]
|
||||
|
||||
@@ -98,10 +98,10 @@ WSGI_APPLICATION = 'fincom.wsgi.application'
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'dbu9ujb6cnhc3n',
|
||||
'USER': 'dexgqmkgoabqyd',
|
||||
'PASSWORD': os.environ['DBPASSWD'],
|
||||
'HOST': 'ec2-50-19-89-124.compute-1.amazonaws.com',
|
||||
'NAME': 'fincom',
|
||||
'USER': 'fincom',
|
||||
'PASSWORD': 'fincom',
|
||||
'HOST': '127.0.0.1',
|
||||
'PORT': '5432',
|
||||
}
|
||||
}
|
||||
@@ -110,8 +110,8 @@ DATABASES = {
|
||||
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
|
||||
AWS_ACCESS_KEY_ID=os.environ['AWS_ACCESS_KEY_ID']
|
||||
AWS_SECRET_ACCESS_KEY=os.environ['AWS_SECRET_ACCESS_KEY']
|
||||
AWS_AUTO_CREATE_BUCKET=True
|
||||
AWS_STORAGE_BUCKET_NAME='fincom'
|
||||
AWS_DEFAULT_ACL=None
|
||||
AWS_S3_FILE_OVERWRITE=False
|
||||
|
||||
|
||||
|
||||
@@ -13,16 +13,16 @@ Including another URLconf
|
||||
1. Import the include() function: from django.conf.urls import url, include
|
||||
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.conf.urls import include, url
|
||||
from django.urls import include, path
|
||||
from django.contrib import admin
|
||||
from . import views
|
||||
|
||||
from fincom import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.index, name='index'),
|
||||
url(r'^logout$', views.user_logout, name='logout'),
|
||||
url(r'^items/', include('items.urls')),
|
||||
url(r'^committees/', include('committee.urls')),
|
||||
url('.well-known/acme-challenge/tVQ35BIrm7ybiASBxRMHG2CAO44x-I2BVMqcrv_yJ2k', views.encrypt, name='encrypt'),
|
||||
url('', include('social_django.urls', namespace='social')),
|
||||
url(r'^admin/', admin.site.urls),
|
||||
path('', views.index, name='index'),
|
||||
path('logout', views.user_logout, name='logout'),
|
||||
path('items/', include('items.urls')),
|
||||
path('committees/', include('committee.urls')),
|
||||
path('', include('social_django.urls', namespace='social')),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
@@ -3,15 +3,12 @@ from django.contrib.auth import logout
|
||||
from django.template import loader
|
||||
|
||||
def index(request):
|
||||
if request.user.is_authenticated():
|
||||
if request.user.is_authenticated:
|
||||
return HttpResponseRedirect('/items')
|
||||
|
||||
template = loader.get_template('fincom/index.html')
|
||||
return HttpResponse(template.render({}, request))
|
||||
|
||||
def encrypt(request):
|
||||
return HttpResponse('tVQ35BIrm7ybiASBxRMHG2CAO44x-I2BVMqcrv_yJ2k.g4Ct3egntTJZl1LOzJH8v9Ri24BQ7blYjcbzPucJVE4', request)
|
||||
|
||||
def user_logout(request):
|
||||
logout(request)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from django.contrib import admin
|
||||
from models import Item
|
||||
from items.models import Item
|
||||
|
||||
# Register your models here.
|
||||
admin.site.register(Item)
|
||||
|
||||
@@ -75,7 +75,7 @@ class Item(models.Model):
|
||||
|
||||
desc = models.CharField(max_length=200)
|
||||
event = models.CharField(max_length=200)
|
||||
committee = models.ForeignKey(Committee)
|
||||
committee = models.ForeignKey(Committee, on_delete=models.DO_NOTHING)
|
||||
details = models.TextField()
|
||||
cost = models.DecimalField(max_digits=7, decimal_places=2)
|
||||
date_purchased = models.DateField('date purchased')
|
||||
@@ -84,7 +84,7 @@ class Item(models.Model):
|
||||
variations={'thumbnail': (600, 600)}
|
||||
)
|
||||
|
||||
created_by = models.ForeignKey(User, related_name='created_by')
|
||||
created_by = models.ForeignKey(User, related_name='created_by', on_delete=models.DO_NOTHING)
|
||||
approved_by = models.ManyToManyField(User, blank=True, related_name='approved_by')
|
||||
date_filed = models.DateTimeField('date filed')
|
||||
status = models.CharField(max_length=2, choices=STATUS)
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
from django.conf.urls import url
|
||||
from . import views
|
||||
from django.urls import path
|
||||
from items import views
|
||||
|
||||
urlpatterns = [
|
||||
url(r'^$', views.list, name='list'),
|
||||
url(r'^(?P<item_id>\d+)/$', views.details, name='details'),
|
||||
url(r'^(?P<item_id>\d+)/approve$', views.approve, name='approve'),
|
||||
url(r'^(?P<item_id>\d+)/reject$', views.reject, name='reject'),
|
||||
url(r'^(?P<item_id>\d+)/edit$', views.edit, name='edit'),
|
||||
url(r'^(?P<item_id>\d+)/delete$', views.delete, name='delete'),
|
||||
url(r'^new$', views.new_form, name='new_form'),
|
||||
path(r'', views.list, name='list'),
|
||||
path('<int:item_id>/', views.details, name='details'),
|
||||
path('<int:item_id>/approve', views.approve, name='approve'),
|
||||
path('<int:item_id>/reject', views.reject, name='reject'),
|
||||
path('<int:item_id>/edit', views.edit, name='edit'),
|
||||
path('<int:item_id>/delete', views.delete, name='delete'),
|
||||
path('new', views.new_form, name='new_form'),
|
||||
]
|
||||
|
||||
@@ -4,8 +4,9 @@ from django.utils import timezone
|
||||
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
|
||||
from django.contrib.auth.decorators import login_required
|
||||
from django.db.models import Q
|
||||
from models import Item
|
||||
|
||||
from committee.models import Committee
|
||||
from items.models import Item
|
||||
|
||||
def isAuthorised(request, item):
|
||||
return (request.user == item.committee.chair
|
||||
|
||||
@@ -1,31 +1,36 @@
|
||||
appdirs==1.4.0
|
||||
boto3==1.9.28
|
||||
botocore==1.12.28
|
||||
Django==1.11.16
|
||||
boto3==1.9.86
|
||||
botocore==1.12.86
|
||||
certifi==2018.11.29
|
||||
chardet==3.0.4
|
||||
defusedxml==0.5.0
|
||||
Django==2.1.5
|
||||
django-cleanup==0.4.2
|
||||
django-stdimage==2.4.1
|
||||
django-storages==1.5.2
|
||||
docutils==0.13.1
|
||||
docutils==0.14
|
||||
futures==3.0.5
|
||||
gunicorn==19.9.0
|
||||
jmespath==0.9.1
|
||||
oauthlib==2.1.0
|
||||
idna==2.8
|
||||
jmespath==0.9.3
|
||||
oauthlib==3.0.1
|
||||
olefile==0.44
|
||||
packaging==16.8
|
||||
Pillow==5.3.0
|
||||
Pillow==4.0.0
|
||||
pkg-resources==0.0.0
|
||||
progressbar2==3.12.0
|
||||
psycopg2-binary==2.7.5
|
||||
PyJWT==1.4.2
|
||||
PyJWT==1.7.1
|
||||
pyparsing==2.1.10
|
||||
python-dateutil==2.6.0
|
||||
python-dateutil==2.7.5
|
||||
python-openid==2.2.5
|
||||
python-utils==2.0.1
|
||||
pytz==2018.5
|
||||
requests==2.13.0
|
||||
requests-oauthlib==0.7.0
|
||||
s3transfer==0.1.10
|
||||
six==1.10.0
|
||||
social-auth-app-django==2.1.0
|
||||
social-auth-core==1.7.0
|
||||
urllib3==1.23
|
||||
python3-openid==3.1.0
|
||||
pytz==2018.9
|
||||
requests==2.21.0
|
||||
requests-oauthlib==1.2.0
|
||||
s3transfer==0.1.13
|
||||
six==1.12.0
|
||||
social-auth-app-django==3.1.0
|
||||
social-auth-core==3.0.0
|
||||
urllib3==1.24.1
|
||||
whitenoise==3.3.0
|
||||
|
||||
Reference in New Issue
Block a user