This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import transaction | |
class AtomicMixin(object): | |
""" | |
Ensures we rollback db transactions on exceptions. | |
Idea from https://github.com/tomchristie/django-rest-framework/pull/1204 | |
""" | |
@transaction.atomic() | |
def dispatch(self, *args, **kwargs): | |
return super(AtomicMixin, self).dispatch(*args, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
NOT PRODUCTION READY | |
Usage: | |
REST_FRAMEWORK = { | |
... | |
'DEFAULT_AUTHENTICATION_CLASSES': ( | |
.... | |
'ibr.users.accounts_api_v0.auth.OidcOauth2Auth' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask, request, render_template | |
from network.parse_passwd import get_remote_user_info | |
app = Flask(__name__) | |
@app.route('/login') |