Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
torsten-simon committed Jul 20, 2023
2 parents 8056882 + 18d4106 commit 30a8498
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ WORKDIR /

COPY entrypoint.sh entrypoint.sh
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
COPY scrapy.cfg scrapy.cfg
COPY setup.cfg setup.cfg
COPY converter/ converter/
COPY csv/ csv/
COPY edu_sharing_client/ edu_sharing_client/
COPY valuespace_converter/ valuespace_converter/
RUN pip3 install -r requirements.txt


ENTRYPOINT ["/entrypoint.sh"]
6 changes: 6 additions & 0 deletions converter/es_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ class CreateGroupType(Enum):
enabled: bool

def __init__(self):
cookie_threshold = env.get('EDU_SHARING_COOKIE_REBUILD_THRESHOLD', True)
if cookie_threshold:
logging.info('Setting COOKIE_REBUILD_THRESHOLD to ' + str(cookie_threshold) + ' seconds')
self.COOKIE_REBUILD_THRESHOLD = cookie_threshold
self.enabled = env.get("MODE", default="edu-sharing") == "edu-sharing"
if self.enabled:
self.initApiClient()
Expand Down Expand Up @@ -644,6 +648,7 @@ def updateItem(self, spider, uuid, item):

@staticmethod
def initCookie():
logging.debug("Init edu sharing cookie...")
settings = get_project_settings()
auth = requests.get(
settings.get("EDU_SHARING_BASE_URL")
Expand All @@ -655,6 +660,7 @@ def initCookie():
headers={"Accept": "application/json"},
)
isAdmin = json.loads(auth.text)["isAdmin"]
logging.info("Got edu sharing cookie, admin status: " + str(isAdmin))
if isAdmin:
cookies = []
for cookie in auth.headers["SET-COOKIE"].split(","):
Expand Down

0 comments on commit 30a8498

Please sign in to comment.