diff options
author | Andrew Godwin | 2022-11-11 22:02:43 -0700 |
---|---|---|
committer | Andrew Godwin | 2022-11-11 22:02:43 -0700 |
commit | feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1 (patch) | |
tree | 3889a826dfc2c852aa4873daff2a27cb7c1a2b01 /statuses/views | |
parent | fbfad9fbf5e061cb7c658dada3c4014c9796021c (diff) | |
download | takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.tar.gz takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.tar.bz2 takahe-feb5d9b74fa1e8454eaaf29afae3643c6d7c81f1.zip |
Got up to incoming posts working
Diffstat (limited to 'statuses/views')
-rw-r--r-- | statuses/views/__init__.py | 0 | ||||
-rw-r--r-- | statuses/views/home.py | 35 |
2 files changed, 0 insertions, 35 deletions
diff --git a/statuses/views/__init__.py b/statuses/views/__init__.py deleted file mode 100644 index e69de29..0000000 --- a/statuses/views/__init__.py +++ /dev/null diff --git a/statuses/views/home.py b/statuses/views/home.py deleted file mode 100644 index b9b98d2..0000000 --- a/statuses/views/home.py +++ /dev/null @@ -1,35 +0,0 @@ -from django import forms -from django.shortcuts import redirect -from django.utils.decorators import method_decorator -from django.views.generic import FormView - -from core.forms import FormHelper -from statuses.models import Status -from users.decorators import identity_required - - -@method_decorator(identity_required, name="dispatch") -class Home(FormView): - - template_name = "statuses/home.html" - - class form_class(forms.Form): - text = forms.CharField() - - helper = FormHelper(submit_text="Post") - - def get_context_data(self): - context = super().get_context_data() - context.update( - { - "statuses": self.request.identity.statuses.all()[:100], - } - ) - return context - - def form_valid(self, form): - Status.create_local( - identity=self.request.identity, - text=form.cleaned_data["text"], - ) - return redirect(".") |