#NEWLINE# def post( self , request , app_id ) : #NEWLINE# #INDENT# '\n        Handles the POST request and updates the application\n\n        Parameters\n        ----------\n        request : django.http.HttpRequest\n            Object representing the request.\n        app_id : int\n            ID identifying the the app in the database.\n\n        Returns\n        -------\n        django.http.HttpResponse\n            Rendered template\n        ' #NEWLINE# context = self . get_context_data ( app_id ) #NEWLINE# app = context . pop ( 'application' , None ) #NEWLINE# if ( app is not None ) : #NEWLINE# #INDENT# data = request . POST #NEWLINE# app . name = strip_tags ( data . get ( 'name' ) ) #NEWLINE# app . description = strip_tags ( data . get ( 'description' ) ) #NEWLINE# app . download_url = data . get ( 'download_url' ) #NEWLINE# app . redirect_uris = data . get ( 'redirect_uris' ) #NEWLINE# app . authorization_grant_type = data . get ( 'authorization_grant_type' ) #NEWLINE# app . save ( ) #NEWLINE# messages . success ( self . request , 'The application has been updated.' ) #NEWLINE# context [ 'application' ] = app #NEWLINE# #UNINDENT# return self . render_to_response ( context )