mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 19:11:09 +00:00
Merge pull request #76 from cthulahoops/user_profile_form
Fix user profile page & rebuilddb.
This commit is contained in:
commit
a0f1880f37
5 changed files with 24 additions and 9 deletions
19
fedireads/migrations/0012_auto_20200308_1625.py
Normal file
19
fedireads/migrations/0012_auto_20200308_1625.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 3.0.3 on 2020-03-08 16:25
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
import fedireads.utils.fields
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('fedireads', '0011_notification'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='author',
|
||||||
|
name='aliases',
|
||||||
|
field=fedireads.utils.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None),
|
||||||
|
),
|
||||||
|
]
|
|
@ -79,6 +79,6 @@ class Author(FedireadsModel):
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
last_name = models.CharField(max_length=255, null=True)
|
last_name = models.CharField(max_length=255, null=True)
|
||||||
first_name = models.CharField(max_length=255, null=True)
|
first_name = models.CharField(max_length=255, null=True)
|
||||||
aliases = ArrayField(models.CharField(max_length=255), blank=True)
|
aliases = ArrayField(models.CharField(max_length=255), blank=True, default=list)
|
||||||
bio = models.TextField(null=True, blank=True)
|
bio = models.TextField(null=True, blank=True)
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
|
|
||||||
{% if is_self %}
|
{% if is_self %}
|
||||||
<div class="interaction">
|
<div class="interaction">
|
||||||
<a href="/user/edit">Edit profile</a>
|
<a href="/edit_profile_page/">Edit profile</a>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -41,8 +41,7 @@ urlpatterns = [
|
||||||
re_path(r'^logout/?$', views.user_logout),
|
re_path(r'^logout/?$', views.user_logout),
|
||||||
re_path(r'^notifications/?', views.notifications_page),
|
re_path(r'^notifications/?', views.notifications_page),
|
||||||
re_path(r'%s/?$' % user_path, views.user_page),
|
re_path(r'%s/?$' % user_path, views.user_page),
|
||||||
re_path(r'%s/edit/?$' % user_path, views.edit_profile_page),
|
re_path(r'edit_profile_page/?$', views.edit_profile_page),
|
||||||
re_path(r'^user/edit/?$', views.edit_profile_page),
|
|
||||||
re_path(r'%s/?$' % status_path, views.status_page),
|
re_path(r'%s/?$' % status_path, views.status_page),
|
||||||
re_path(r'^book/(?P<book_identifier>\w+)/?$', views.book_page),
|
re_path(r'^book/(?P<book_identifier>\w+)/?$', views.book_page),
|
||||||
re_path(r'^book/(?P<book_identifier>\w+)/(?P<tab>friends|local|federated)?$', views.book_page),
|
re_path(r'^book/(?P<book_identifier>\w+)/(?P<tab>friends|local|federated)?$', views.book_page),
|
||||||
|
|
|
@ -204,12 +204,9 @@ def status_page(request, username, status_id):
|
||||||
|
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
def edit_profile_page(request, username):
|
def edit_profile_page(request):
|
||||||
''' profile page for a user '''
|
''' profile page for a user '''
|
||||||
try:
|
user = request.user
|
||||||
user = models.User.objects.get(localname=username)
|
|
||||||
except models.User.DoesNotExist:
|
|
||||||
return HttpResponseNotFound()
|
|
||||||
|
|
||||||
form = forms.EditUserForm(instance=request.user)
|
form = forms.EditUserForm(instance=request.user)
|
||||||
data = {
|
data = {
|
||||||
|
|
Loading…
Reference in a new issue