Better management of manually-set members.
[wolnelektury.git] / src / club / payu / forms.py
1 # This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
3 #
4 from django import forms
5
6
7 class CardTokenForm(forms.Form):
8     token = forms.CharField(widget=forms.HiddenInput)
9
10     def get_queryset(self, view):
11         raise NotImplementedError()
12
13     def save(self, view):
14         self.instance, created = self.get_queryset(view).get_or_create(
15             pos_id=view.get_pos().pos_id,
16             disposable_token=self.cleaned_data['token']
17         )