Skip to content

Commit c28a602

Browse files
committed
Updated logout to disable automatic logout on volunteer_chat
1 parent 3eefb2f commit c28a602

File tree

6 files changed

+22
-9
lines changed

6 files changed

+22
-9
lines changed

forge/settings.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,8 @@
139139

140140
LOGIN_URL = '/login'
141141

142-
CHAT_SITE_URL="172.18.54.169"
143-
CHAT_SITE_PORT=8000
142+
CHAT_SITE_URL="127.0.0.1"
143+
CHAT_SITE_PORT=8001
144144

145145

146146
# Allow pages to be loaded in a frame

forge/static/forge/js/logout.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ function notify() {
66

77

88
function automatic_logout() {
9-
location.replace("/logout");
9+
10+
if(typeof disable_logout !== 'undefined' && disable_logout){
11+
logout_event = setTimeout(automatic_logout, 1000 * 60 * 10);
12+
return;
13+
}
14+
15+
location.replace("/logout");
1016
setTimeout(notify, 10);
1117
}
1218

13-
1419
logout_event = setTimeout(automatic_logout, 1000 * 60 * 10);
1520

16-
document.onclick = function() {
21+
function update_logout() {
1722
clearTimeout(logout_event);
1823
logout_event = setTimeout(automatic_logout, 1000 * 60 * 10);
19-
}
24+
}
25+

machine_usage/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def create_machine_usage(request):
123123
u.machine = machine
124124
u.userprofile = request.user.userprofile
125125
u.save() # Necessary so start_time gets set to current time before referencing it below
126-
u.set_end_time(int(data["hours"]), int(data["minutes"]))
126+
u.set_end_time(float(data["hours"]), float(data["minutes"]))
127127

128128
u.for_class = for_class
129129
u.own_material = own_material

myforge/templates/myforge/myforge.html

+7
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,15 @@
6767

6868
{% block scripts %}
6969
<script>
70+
var disable_logout = false;
71+
7072
function setFrame(src) {
7173
$("#myforge_frame").attr("src", src);
74+
if(src == 'dyn/volunteer_chat_join'){
75+
disable_logout = true;
76+
} else {
77+
disable_logout = false;
78+
}
7279
}
7380

7481
setFrame('dyn/project_list');

myforge/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def get_chat_url(request, path):
5050
def user_chat(request):
5151
#return HttpResponseRedirect("http://10.0.0.24:8000/user/chat?uuid={}".format(request.user.userprofile.uuid))
5252
url = get_chat_url(request, '/user/info')
53-
53+
5454

5555
return render(request, 'myforge/forms/user_chat_template.html', {'channels_link':url})
5656

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ google-auth-oauthlib==0.4.1
1111
httplib2>=0.18.0
1212
idna==2.8
1313
oauthlib==3.1.0
14-
Django==2.2.14
14+
django==2.2.14
1515
psycopg2==2.8.4
1616
pyasn1==0.4.8
1717
pyasn1-modules==0.2.7

0 commit comments

Comments
 (0)