[copr] master: If user logs in from url_root, redirect him to his coprs, else to where he was (8296a76)

bkabrda at fedoraproject.org bkabrda at fedoraproject.org
Tue Jan 22 09:09:47 UTC 2013


Repository : http://git.fedorahosted.org/cgit/copr.git

On branch  : master

>---------------------------------------------------------------

commit 8296a76f566f50382c98a7e541a18a4515134df6
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Tue Jan 22 09:28:11 2013 +0100

    If user logs in from url_root, redirect him to his coprs, else to where he was


>---------------------------------------------------------------

 coprs_frontend/coprs/views/misc.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/coprs_frontend/coprs/views/misc.py b/coprs_frontend/coprs/views/misc.py
index 9640d8b..4dadce9 100644
--- a/coprs_frontend/coprs/views/misc.py
+++ b/coprs_frontend/coprs/views/misc.py
@@ -61,6 +61,9 @@ def create_or_login(resp):
         db.session.commit()
     flask.flash(u'Welcome, {0}'.format(user.name))
     flask.g.user = user
+    redirect_to = oid.get_next_url()
+    if flask.request.url_root == oid.get_next_url():
+        return flask.redirect(flask.url_for('coprs_ns.coprs_by_owner', username=user.name))
     return flask.redirect(oid.get_next_url())
 
 



More information about the copr-devel mailing list