예제 #1
0
def init_cached_translations():
    """This method initializes the app cached translations"""
    global deployed_translations
    logging.info("Initializing cached translations")
    metadata = SnapshotMetadata.all().filter('active =', True).get()
    if metadata:
        snapshot = SnapshotContent.all().filter('metadata =', metadata).get()
        deployed_translations = simplejson.loads(snapshot.json)
예제 #2
0
def init_cached_translations():
    """This method initializes the app cached translations"""
    global deployed_translations
    logging.info("Initializing cached translations")
    metadata = SnapshotMetadata.all().filter('active =', True).get()
    if metadata:
        snapshot = SnapshotContent.all().filter('metadata =', metadata).get()
        deployed_translations = simplejson.loads(snapshot.json)
예제 #3
0
    def delete(self):
        """Delete specific snapshot"""
        if not users.is_current_user_admin():
            self.error(403)

        snapshot_id = self.request.path.split('/')[-1]
        metadata = SnapshotMetadata.get_by_id(int(snapshot_id))
        content = SnapshotContent.all().filter('metadata =', metadata).get()

        if metadata:
            content.delete()
            metadata.delete()
            self.response.headers['Content-Type'] = 'text/plain'
            self.response.out.write('success');
        else:
            self.error(404)
예제 #4
0
    def delete(self):
        """Delete specific snapshot"""
        if not users.is_current_user_admin():
            self.error(403)

        snapshot_id = self.request.path.split('/')[-1]
        metadata = SnapshotMetadata.get_by_id(int(snapshot_id))
        content = SnapshotContent.all().filter('metadata =', metadata).get()

        if metadata:
            content.delete()
            metadata.delete()
            self.response.headers['Content-Type'] = 'text/plain'
            self.response.out.write('success')
        else:
            self.error(404)