Skip to content

Commit 9ac6cdc

Browse files
committed
Fixed refactoring bug.
- Legacy-Id: 5485
1 parent fc369a6 commit 9ac6cdc

1 file changed

Lines changed: 22 additions & 11 deletions

File tree

ietf/meeting/views.py

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,6 @@ def agenda_infoREDESIGN(num=None):
167167
agenda_info = agenda_infoREDESIGN
168168

169169
def get_agenda_info(request, num=None):
170-
if settings.SERVER_MODE != 'production' and '_testiphone' in request.REQUEST:
171-
user_agent = "iPhone"
172-
elif 'user_agent' in request.REQUEST:
173-
user_agent = request.REQUEST['user_agent']
174-
elif 'HTTP_USER_AGENT' in request.META:
175-
user_agent = request.META["HTTP_USER_AGENT"]
176-
else:
177-
user_agent = ""
178-
if "iPhone" in user_agent:
179-
return iphone_agenda(request, num)
180-
181170
meeting = get_meeting(num)
182171
timeslots = TimeSlot.objects.filter(Q(meeting__id = meeting.id)).order_by('time','name')
183172
modified = timeslots.aggregate(Max('modified'))['modified__max']
@@ -192,6 +181,17 @@ def get_agenda_info(request, num=None):
192181

193182
@decorator_from_middleware(GZipMiddleware)
194183
def html_agenda(request, num=None):
184+
if settings.SERVER_MODE != 'production' and '_testiphone' in request.REQUEST:
185+
user_agent = "iPhone"
186+
elif 'user_agent' in request.REQUEST:
187+
user_agent = request.REQUEST['user_agent']
188+
elif 'HTTP_USER_AGENT' in request.META:
189+
user_agent = request.META["HTTP_USER_AGENT"]
190+
else:
191+
user_agent = ""
192+
if "iPhone" in user_agent:
193+
return iphone_agenda(request, num)
194+
195195
timeslots, modified, meeting, area_list, wg_list = get_agenda_info(request, num)
196196
return HttpResponse(render_to_string("meeting/agenda.html",
197197
{"timeslots":timeslots, "modified": modified, "meeting":meeting,
@@ -201,6 +201,17 @@ def html_agenda(request, num=None):
201201

202202
@decorator_from_middleware(GZipMiddleware)
203203
def html_agenda_utc(request, num=None):
204+
if settings.SERVER_MODE != 'production' and '_testiphone' in request.REQUEST:
205+
user_agent = "iPhone"
206+
elif 'user_agent' in request.REQUEST:
207+
user_agent = request.REQUEST['user_agent']
208+
elif 'HTTP_USER_AGENT' in request.META:
209+
user_agent = request.META["HTTP_USER_AGENT"]
210+
else:
211+
user_agent = ""
212+
if "iPhone" in user_agent:
213+
return iphone_agenda(request, num)
214+
204215
timeslots, modified, meeting, area_list, wg_list = get_agenda_info(request, num)
205216
return HttpResponse(render_to_string("meeting/agenda_utc.html",
206217
{"timeslots":timeslots, "modified": modified, "meeting":meeting,

0 commit comments

Comments
 (0)