• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DemocracyClub / WhoCanIVoteFor / 0eeeb5e8-67c1-4af3-a172-6d12738e6936

28 Apr 2026 11:25AM UTC coverage: 59.561% (-0.02%) from 59.584%
0eeeb5e8-67c1-4af3-a172-6d12738e6936

Pull #1841

circleci

awdem
ignore router on lambda
Pull Request #1841: Development

0 of 3 new or added lines in 2 files covered. (0.0%)

1 existing line in 1 file now uncovered.

3068 of 5151 relevant lines covered (59.56%)

0.6 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/wcivf/lambda_handler.py
1
import json
×
NEW
2
import os
×
3

4
import django
×
5
import sentry_sdk
×
6
from django.core.management import call_command
×
7

8

9
def handler(event, context):
×
10
    """
11
    Parameters
12
    ----------
13
    event: dict, required
14
        Either an SQS event (when invoked via the SQS event source mapping) or
15
        a direct invocation payload. SQS events wrap the command payload in
16
        Records[0].body as a JSON string.
17

18
        SQS event doc: https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html
19

20
    context: object, required
21
        Lambda Context runtime methods and attributes
22

23
        Context doc: https://docs.aws.amazon.com/lambda/latest/dg/python-context-object.html
24

25
    Returns
26
    ------
27
    dict with statusCode and body
28
    """
29
    if "Records" in event:
×
30
        event = json.loads(event["Records"][0]["body"])
×
31

32
    cmd = event["command"]
×
33
    args = event.get("args", [])
×
34

35
    sentry_sdk.set_context("event", event)
×
NEW
36
    os.environ["IGNORE_ROUTERS"] = "1"
×
37
    django.setup()
×
38

39
    print(f"Calling {cmd} with args {args}")
×
40
    call_command(cmd, *args)
×
41

42
    arg_str = " ".join(args)
×
43
    return {
×
44
        "statusCode": 200,
45
        "body": json.dumps(
46
            {
47
                "message": f"{cmd} {arg_str} completed",
48
            }
49
        ),
50
    }
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc