Skip to content

Commit fba62d1

Browse files
authored
Merge pull request #327 from Mosquito-Alert/redirect_entolab_users
Redirect entolab users to new frontend
2 parents 05e7a2f + d8c0fac commit fba62d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tigacrafting/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from django.contrib.auth.decorators import login_required
2121
from random import shuffle
2222
from django.template.context_processors import csrf
23-
from django.http import HttpResponseRedirect
23+
from django.http import HttpResponseRedirect, HttpResponsePermanentRedirect
2424
from django.urls import reverse
2525
from django.conf import settings
2626
from django.http import HttpResponse
@@ -535,6 +535,9 @@ def expert_report_annotation(request, scroll_position='', tasks_per_page='10', n
535535
if not (this_user_is_expert or this_user_is_superexpert):
536536
return HttpResponse("You need to be logged in as an expert member to view this page. If you have have been recruited as an expert and have lost your log-in credentials, please contact MoveLab.")
537537

538+
if not this_user_is_superexpert:
539+
return HttpResponsePermanentRedirect('https://app.mosquitoalert.com')
540+
538541
args = {}
539542
args.update(csrf(request))
540543
args['scroll_position'] = scroll_position
@@ -786,6 +789,8 @@ def single_report_view(request,version_uuid):
786789
this_user = request.user
787790
version_uuid = request.GET.get('version_uuid', version_uuid)
788791
report = Report.objects.get(pk=version_uuid)
792+
if not this_user.userstat.is_superexpert():
793+
return HttpResponsePermanentRedirect('https://app.mosquitoalert.com/identification_tasks/'+str(version_uuid))
789794
who_has_list = []
790795
if report:
791796
for ano in report.expert_report_annotations.select_related('user').all():

0 commit comments

Comments
 (0)