def require_registration(resource_name):
 def real_decorator_wrapper(handler):
  def real_decorator_wrapper_fn(request, *args, **kwargs):
   if (Device.get_own_device().is_registered() or (not am_i_online(settings.CENTRAL_SERVER_URL))):
    return handler(request, *args, **kwargs)
   else:
    messages.warning(request, _(('In order to access %(resource_name)s, you must register your device first.' % {'resource_name': unicode(resource_name)})))
    return HttpResponseRedirect(set_query_params(reverse('register_public_key'), {'next': request.path}))
  return real_decorator_wrapper_fn
 return real_decorator_wrapper

def require_registration ( resource_name ) : def real_decorator_wrapper ( handler ) : def real_decorator_wrapper_fn ( request , * args , ** kwargs ) : if ( Device . get_own_device ( ) . is_registered ( ) or ( not am_i_online ( settings . CENTRAL_SERVER_URL ) ) ) : return handler ( request , * args , ** kwargs ) else : messages . warning ( request , _ ( ( 'In order to access %(resource_name)s, you must register your device first.' % { 'resource_name' : unicode ( resource_name ) } ) ) ) return HttpResponseRedirect ( set_query_params ( reverse ( 'register_public_key' ) , { 'next' : request . path } ) ) return real_decorator_wrapper_fn return real_decorator_wrapper
gets id of requested user .