Skip to content

Instantly share code, notes, and snippets.

View robinharms's full-sized avatar

Robin Harms Oredsson robinharms

  • Betahaus
  • Stockholm
View GitHub Profile
@robinharms
robinharms / workflow.py
Created April 30, 2020 09:45
Simple workflow, before i found django_fsm. In case I ever need it again :P
from abc import ABC, abstractmethod
from logging import getLogger
from typing import Dict, Union, List, Set, TypeVar, Tuple, Optional
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied
from voteit.core import signals
from voteit.core.component import FactoryRegistry
logger = getLogger(__name__)
import unittest
from pyramid import testing
from pyramid.authorization import ACLAuthorizationPolicy
from pyramid.security import Allow, DENY_ALL
from pyramid.authentication import SessionAuthenticationPolicy
from pyramid.testing import DummySession
EDIT = 'edit'