Permalink
Browse files

added some refactoring code

  • Loading branch information...
1 parent 050a0be commit 400de4a19ec3bc388fb1ada604707a6e6f0d128b unknown committed Mar 7, 2012
Showing with 21 additions and 2 deletions.
  1. +1 −1 phonehub/aastra/api.py
  2. +1 −1 phonehub/aastra/items.py
  3. +19 −0 phonehub/decorators.py
View
@@ -1,7 +1,7 @@
'''
Created on 01/03/2012
-@author: ogonbat
+@author: cingusoft
'''
from phonehub.aastra.items import ExecuteItem, MessageItem, inputItem,\
LineItem, URIItem, MenuItem, IconItem, SoftKeyItem, ConfigurationItem
View
@@ -1,7 +1,7 @@
'''
Created on 05/03/2012
-@author: ogonbat
+@author: cingusoft
'''
class ConfigurationItem():
_configuration_list = []
View
@@ -0,0 +1,19 @@
+'''
+Created on 07/03/2012
+
+@author: cingusoft
+'''
+from django.utils.functional import wraps
+from django.http import HttpResponseRedirect
+
+def is_aastra(view):
+ @wraps(view)
+ def inner(request,*args,**kwargs):
+ user_agent = request.META['HTTP_USER_AGENT']
+ partial_agent = user_agent.split(' ')
+ if "Aastra" in partial_agent[0]:
+ pass
+ else:
+ return HttpResponseRedirect(settings.LOGIN_URL)
+ return view(request,*args,**kwargs)
+ return inner

0 comments on commit 400de4a

Please sign in to comment.