Skip to content

Queue event #8

Description

@github-actions

Set up an event-bus so that the discord bot can be notified by the nfc scanner

# TODO: Queue event

fromdjango.shortcutsimportrenderfromdjango.views.decorators.httpimportrequire_POSTfromdjango.views.decorators.cacheimportnever_cachefromdjango.httpimportJsonResponsefromdatabase.modelsimportAttendant@require_POST@never_cachedefscanned(request, tag: bytes):
try:
attendant=Attendant.objects.get(tag=tag)
# TODO: Queue eventreturnJsonResponse({"valid": attendant.is_valid}, status=202)
exceptAttendant.DoesNotExist:
returnJsonResponse({"error": "No such tag"}, status=404)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions