X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/2f9cb34a07fcd98effda2fa900e48c31813f14c8..c2a6a31c6e1f6dafa17ab8e5bbd5714800ae36a3:/apps/organizations/views.py?ds=sidebyside diff --git a/apps/organizations/views.py b/apps/organizations/views.py index a7d69802..24f2436f 100644 --- a/apps/organizations/views.py +++ b/apps/organizations/views.py @@ -1,12 +1,16 @@ -# Create your views here. +# -*- coding: utf-8 -*- +# +# This file is part of MIL/PEER, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.shortcuts import render, redirect -from django.http import HttpResponse, Http404 -#from django.views.decorators import require_post +from django.http import Http404 from .forms import OrganizationForm, UserCardForm from .models import Organization, Membership, UserCard + @login_required def org_new(request): if request.method == 'POST': @@ -38,6 +42,7 @@ def main(request, pk, tab='documents'): 'am_member': am_member, }) + def user_card(request, pk): try: user = User.objects.get(pk=pk) @@ -92,8 +97,8 @@ def join(request, pk): return render(request, 'organizations/join.html', {'org': org}) + @login_required -#@POST_required def membership(request, pk): try: org = Organization.objects.get(pk=pk)