Compare commits
3 Commits
77f8567e21
...
3402d747e7
Author | SHA1 | Date |
---|---|---|
Sergey | 3402d747e7 | |
Nicholas Kumia | 9306edb3b2 | |
Nicholas Kumia | 776a0260cc |
|
@ -4,10 +4,10 @@ jobs:
|
|||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.6'
|
||||
python-version: '3.9'
|
||||
- name: Install requirements
|
||||
run: pip install flake8 pycodestyle
|
||||
- name: Check syntax
|
||||
|
|
|
@ -7,6 +7,7 @@ import re
|
|||
import logging
|
||||
import click
|
||||
import ckan.model as model
|
||||
import ckan.plugins.toolkit as tk
|
||||
|
||||
from . import dbutil, config
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@ def tracking_mode():
|
|||
if id_.startswith("GTM-"):
|
||||
return "gtm"
|
||||
|
||||
|
||||
return "ga"
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
from apiclient.discovery import build
|
||||
from oauth2client.service_account import ServiceAccountCredentials
|
||||
|
||||
from ckanext.googleanalytics import utils, config
|
||||
from ckanext.googleanalytics import config
|
||||
|
||||
|
||||
def init_service(credentials_file):
|
||||
|
|
|
@ -45,5 +45,6 @@ def googleanalytics_header():
|
|||
def googleanalytics_tracking_mode():
|
||||
return config.tracking_mode()
|
||||
|
||||
|
||||
def googleanalytics_id():
|
||||
return config.tracking_id()
|
||||
|
|
|
@ -4,7 +4,7 @@ import ckan.plugins.toolkit as tk
|
|||
from ckan.logic import validate
|
||||
|
||||
from . import schema
|
||||
from .. import utils, config
|
||||
from .. import config
|
||||
from ..model import PackageStats, ResourceStats
|
||||
from ..ga_auth import init_service, get_profile_id
|
||||
|
||||
|
|
|
@ -3,6 +3,7 @@ import pytest
|
|||
import ckan.plugins.toolkit as tk
|
||||
from ckanext.googleanalytics import config
|
||||
|
||||
|
||||
def _render_header(mode, tracking_id):
|
||||
return tk.render_snippet("googleanalytics/snippets/_{}.html".format(mode), {
|
||||
"googleanalytics_id": tracking_id,
|
||||
|
|
|
@ -68,7 +68,7 @@ def _mp_event(event):
|
|||
data=json.dumps({
|
||||
"client_id": config.measurement_protocol_client_id(),
|
||||
"non_personalized_ads": False,
|
||||
"events":[event]
|
||||
"events": [event]
|
||||
}, cls=SafeJSONEncoder)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue