Stats
anonymize_email(email_address)
¶
Split the email address into it's identity and domain parts, then return the secure hash of the identity and the domain. Bcrypt is used to securely hash the identity, using the domain as the salt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
email_address
|
the email address |
required |
Returns:
| Type | Description |
|---|---|
|
a 2-tuple of the email address and the domain |
Source code in ckanext/query_dois/lib/stats.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | |
record_stat(query_doi, action, email_address=None, domain=None, identifier=None)
¶
Creates a new QueryDOIStat object and saves it to the database.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query_doi
|
the QueryDOI object against which the stat should be stored |
required | |
action
|
the action that occurred to trigger this stat (for example: "download") |
required | |
email_address
|
the email address of the user performing the action |
None
|
|
domain
|
an alternate domain name if email not specified |
None
|
|
identifier
|
an alternate identifier if email not specified |
None
|
Returns:
| Type | Description |
|---|---|
|
a new QueryDOIStat object |
Source code in ckanext/query_dois/lib/stats.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |