content creation auto acceptance: |
|
---|---|
adding a role to content: |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table roles( | |
id integer unique sequence, | |
document_id uuid, | |
role_type role_types, -- e.g. author, illustrator | |
user_id text, -- username as it appears in accounts | |
profile json, -- a copy of the user's profile json | |
has_accepted boolean, | |
requester text, | |
assignment_data timestamp with timezone default current_timestamp, | |
primary key (document_id, role_type, user_id), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[coyote] | |
# These queue to runner mappings (<queue_name>:<runner_name>) propulate the | |
# queues list to run through during runtime. | |
queue-mappings = | |
cnx_any_latex_completezip:completezip | |
[amqp] | |
host = localhost | |
port = 5672 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<html xmlns="http://www.w3.org/1999/xhtml" | |
xmlns:epub="http://www.idpf.org/2007/ops" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:lrmi="http://lrmi.net/the-specification" | |
> | |
<head itemscope="itemscope" | |
itemtype="http://schema.org/Book" | |
> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{'contents': [{'contents': [{'contents': [{'id': '[email protected]', | |
'title': 'Document One'}], | |
'id': 'subcol', | |
'title': u'Chapter One'}, | |
{'contents': [{'id': '[email protected]', | |
'title': 'Document One (revised)'}], | |
'id': 'subcol', | |
'title': u'Chapter Two'}], | |
'id': 'subcol', | |
'title': u'Part One'}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/cnxpublishing/db.py b/cnxpublishing/db.py | |
index d702f41..eeb1c77 100644 | |
--- a/cnxpublishing/db.py | |
+++ b/cnxpublishing/db.py | |
@@ -103,6 +103,17 @@ update pending_documents set license_accepted = 't' | |
where id = %s""", (document_id,)) | |
+def add_pending_resource(cursor, resource): | |
+ """Adds a pending resource to the database.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html> <!-- This is required in HTML5 --> | |
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" | |
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" | |
xmlns:lrmi="http://lrmi.net/the-specification" | |
> | |
<!-- For EPUB parsing/validation python should only care about data-* attributes. | |
Other attributes are for discoverability and compatibility with schema.org . --> |
- GET license on existing content /publications/{id}/license/{user-id} returns 200 Ok.
- GET license for content that needs license acceptance /publications/{id}/license/{user-id} returns 400 Bad Request.
- POST license for content that needs license acceptance /publications/{id}/license/{user-id} accepts license and returns 200 Ok.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
class CheckTests(unittest.TestCase): | |
# These tests assume a remote (or local) service is communicating with | |
# this service to verify the token it was given is valid. | |
def setUp(self): | |
self.config = testing.setUp() | |
from sqlalchemy import create_engine | |
engine = create_engine('sqlite://') |