Skip to content

Commit 93d299c

Browse files
committed
doing what git wants
1 parent 3a44489 commit 93d299c

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed

bil_site/settings.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@
8585
'django_filters',
8686
'bootstrap4',
8787
'django_pam',
88+
'hijack',
89+
'hijack.contrib.admin',
8890
#'core',
8991
]
9092

@@ -96,6 +98,7 @@
9698
'django.contrib.auth.middleware.AuthenticationMiddleware',
9799
'django.contrib.messages.middleware.MessageMiddleware',
98100
'django.middleware.clickjacking.XFrameOptionsMiddleware',
101+
'hijack.middleware.HijackUserMiddleware',
99102
]
100103

101104
ROOT_URLCONF = 'bil_site.urls'

bil_site/urls.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@
2525
path('admin/', admin.site.urls),
2626
path('accounts/', include('django.contrib.auth.urls')),
2727
path('', RedirectView.as_view(url='/ingest/')),
28+
path('hijack/', include('hijack.urls')),
2829
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

ingest/templates/ingest/index.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
{% block content %}
44

55
<div class="container-fluid white_on_gray">
6-
<div class="row">
76

7+
<div class="row">
88
<div class="col-lg-12 big-row-text">
99
<h1>Data Submission Portal</h1>
1010
<p>The Brain Image Library (BIL) is a public resource enabling
@@ -19,8 +19,14 @@ <h1>Data Submission Portal</h1>
1919
</div>
2020

2121
</div>
22+
{% for message in messages %}
23+
<div style="width: px; margin-left:0px; " class="alert alert-{{ message.tags }} " id="msg" role="alert">
24+
{{ message }}
25+
26+
{% endfor %}
2227
</div>
2328

29+
2430
{% if request.user.username %}
2531

2632
<div class="container-fluid gray_on_med_blue">

ingest/views.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,12 @@ def collection_send(request):
479479
@login_required
480480
def collection_create(request):
481481
current_user = request.user
482-
people = People.objects.get(auth_user_id_id = current_user.id)
483-
project_person = ProjectPeople.objects.filter(people_id = people.id).all()
482+
try:
483+
people = People.objects.get(auth_user_id_id = current_user.id)
484+
project_person = ProjectPeople.objects.filter(people_id = people.id).all()
485+
except ObjectDoesNotExist:
486+
messages.info(request, 'Error: Your account is likely not fully set up. Follow along with your Sign Up ticket on bil-support and provide the appropriate Grant Name and Number to the Project you will be submitting for. If you have already done so, kindly nudge us to complete your account creation.')
487+
return redirect('/')
484488
for attribute in project_person:
485489
if attribute.is_pi:
486490
pi = True
@@ -2194,8 +2198,12 @@ def check_all_sheets(filename):
21942198
@login_required
21952199
def descriptive_metadata_upload(request):
21962200
current_user = request.user
2197-
people = People.objects.get(auth_user_id_id = current_user.id)
2198-
project_person = ProjectPeople.objects.filter(people_id = people.id).all()
2201+
try:
2202+
people = People.objects.get(auth_user_id_id = current_user.id)
2203+
project_person = ProjectPeople.objects.filter(people_id = people.id).all()
2204+
except:
2205+
messages.info(request, 'Error: Your account is likely not fully set up. Follow along with your Sign Up ticket on bil-support and provide the appropriate Grant Name and Number to the Project you will be submitting for. If you have already done so, kindly nudge us to complete your account creation.')
2206+
return redirect('/')
21992207
for attribute in project_person:
22002208
if attribute.is_pi:
22012209
pi = True

requirements.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
amqp==5.0.9
2-
asgiref==3.3.2
2+
asgiref==3.5.2
33
asn1crypto==0.24.0
4-
#backports.zoneinfo==0.2.1
54
bcrypt==3.1.4
65
beautifulsoup4==4.9.3
76
billiard==3.6.4.0
@@ -12,10 +11,11 @@ click-didyoumean==0.3.0
1211
click-plugins==1.1.1
1312
click-repl==0.2.0
1413
cryptography==3.3.2
15-
Django==3.2.13
14+
Django==3.2.18
1615
django-bootstrap4==2.3.1
1716
django-celery-results==2.0.0
1817
django-filter==2.4.0
18+
django-hijack==3.2.6
1919
django-pam==2.0.0
2020
django-tables2==2.3.4
2121
et-xmlfile==1.0.1
@@ -48,9 +48,9 @@ six==1.11.0
4848
soupsieve==2.2.1
4949
sqlparse==0.4.2
5050
texttable==1.2.1
51+
tzdata==2022.1
5152
vine==5.0.0
5253
wcwidth==0.2.5
5354
xlrd==1.2.0
5455
xlwt==1.3.0
5556
zipp==3.4.1
56-
tzdata==2022.1

0 commit comments

Comments
 (0)