mediagoblin-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GMG-Devel] Intro [+ patch]


From: ĎÚβĨŐÚŚ Dod
Subject: [GMG-Devel] Intro [+ patch]
Date: Mon, 25 Jun 2018 02:47:06 -0400

Hi.
We've installed a publicly-accessible MG instance at a place I work with. It's still alpha (e.g. most of the jinja templates are in a terrible state at the moment), but you can access it at the temporary domain https://portal.israrchive.com

We've done some minor code changes, and some of them [we believe] are bug fixes (see example patch below).

In order to conform with the AGPL license, we'll need to link to a repo/branch with our instance's code. How do you folks "normally" do this? Host the repo at some public "git warehouse"? Do it inhouse (e.g. gitweb)? Does Savannah let people maintain a branch or a fork?

Also: how do we do the equivalent of pull-requests here?

Nice to meet you all.
The Dod

----->8------------------------
From 8ec7feceadb3feb042883b2d6c6b9f30975368dd Mon Sep 17 00:00:00 2001
From: The Dod <thedod@localhost>
Date: Sun, 24 Jun 2018 03:16:35 +0300
Subject: [PATCH] Fix it so that edit forms come pre-filled with existing info

---
mediagoblin/edit/views.py | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/mediagoblin/edit/views.py b/mediagoblin/edit/views.py
index 00c6115..9b9647d 100644
--- a/mediagoblin/edit/views.py
+++ b/mediagoblin/edit/views.py
@@ -66,7 +66,7 @@ def edit_media(request, media):
         license=media.license)

     form = forms.EditForm(
-        request.form,
+        request.method=='POST' and request.form or None,
         **defaults)

     if request.method == 'POST' and form.validate():
@@ -208,7 +208,8 @@ def edit_profile(request, url_user=None):
     else:
         location = user.get_location.name

-    form = forms.EditProfileForm(request.form,
+    form = forms.EditProfileForm(
+        request.method == 'POST' and request.form or None,
         url="">
         bio=user.bio,
         location=location)
@@ -248,7 +249,8 @@ EMAIL_VERIFICATION_TEMPLATE = (
@require_active_login
def edit_account(request):
     user = request.user
-    form = forms.EditAccountForm(request.form,
+    form = forms.EditAccountForm(
+        request.method == 'POST' and request.form or None,
         wants_comment_notification=user.wants_comment_notification,
         license_preference=user.license_preference,
         wants_notifications=user.wants_notifications)
@@ -344,7 +346,7 @@ def edit_collection(request, collection):
         description=collection.description)

     form = forms.EditCollectionForm(
-        request.form,
+        request.method == 'POST' and request.form or None,
         **defaults)

     if request.method == 'POST' and form.validate():
@@ -436,7 +438,8 @@ def verify_email(request):

def change_email(request):
     """ View to change the user's email """
-    form = forms.ChangeEmailForm(request.form)
+    form = forms.ChangeEmailForm(
+        request.method == 'POST' and request.form or None)
     user = request.user

     # If no password authentication, no need to enter a password
@@ -489,7 +492,8 @@ def change_email(request):
@require_active_login
@get_media_entry_by_id
def edit_metadata(request, media):
-    form = forms.EditMetaDataForm(request.form)
+    form = forms.EditMetaDataForm(
+        request.method == 'POST' and request.form or None)
     if request.method == "POST" and form.validate():
         metadata_dict = dict([(row['identifier'],row['value'])
                             for row in form.media_metadata.data])
--
2.7.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]