Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
U
url_shorter_docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Leder
url_shorter_docker
Commits
08dd6938
Commit
08dd6938
authored
5 years ago
by
Jonas Leder
Browse files
Options
Downloads
Patches
Plain Diff
fixed links in userprofile
parent
c2d14733
No related branches found
No related tags found
No related merge requests found
Pipeline
#172
passed
5 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
main.py
+1
-1
1 addition, 1 deletion
main.py
userprofile.py
+2
-2
2 additions, 2 deletions
userprofile.py
with
3 additions
and
3 deletions
main.py
+
1
−
1
View file @
08dd6938
...
...
@@ -160,7 +160,7 @@ def redirectOwnLinks():
@app.route
(
'
/user/links<pageNumber>
'
)
#This function gives the user the posibility to see and delete his links
def
ownLinks
(
pageNumber
):
return
userProfile
(
request
,
cookieNotice
,
s
,
pageNumber
)
return
userProfile
(
request
,
cookieNotice
,
s
,
pageNumber
,
url_scheme
)
@app.route
(
'
/user/delete
'
)
#This function is called if a user deletes an entrie
def
delete
():
...
...
This diff is collapsed.
Click to expand it.
userprofile.py
+
2
−
2
View file @
08dd6938
...
...
@@ -2,7 +2,7 @@ import sqlite3
from
flask
import
redirect
,
abort
,
render_template
from
html
import
escape
#This is used to escape characters, if they are send in the url
def
userProfile
(
request
,
cookieNotice
,
s
,
pageNumber
):
def
userProfile
(
request
,
cookieNotice
,
s
,
pageNumber
,
url_scheme
):
backButton
=
0
nextButton
=
0
lenEntries
=
0
...
...
@@ -32,7 +32,7 @@ def userProfile(request, cookieNotice, s, pageNumber):
calls
=
str
(
cursor2
.
execute
(
'
SELECT CALLS FROM ANALYTICS WHERE SHORT_URL=?
'
,
[
entries
[
1
]]).
fetchone
()[
0
])
except
:
calls
=
"
0
"
response
=
response
+
"
<tr>
\n
<td>
"
+
entries
[
0
]
+
"
</td>
\n
<td><a href=
\"
"
+
entries
[
1
]
+
'"
>
'
+
entries
[
1
]
+
'
</a></td>
\n
<td>
'
+
calls
+
'
</td>
\n
<td><a id=
"
red
"
href=
"
/user/delete?link=
'
+
escape
(
entries
[
1
])
+
'"
>delete</a> <a href=
"
#
"
id=
"
dialog-link
"
onclick=
"
buttonListener(
\'
'
+
entries
[
1
]
+
'
\'
, this)
"
>QR</a></tr>
\n
'
response
=
response
+
"
<tr>
\n
<td>
"
+
entries
[
0
]
+
"
</td>
\n
<td><a href=
\"
"
+
url_scheme
+
"
://
"
+
entries
[
1
]
+
'"
>
'
+
entries
[
1
]
+
'
</a></td>
\n
<td>
'
+
calls
+
'
</td>
\n
<td><a id=
"
red
"
href=
"
/user/delete?link=
'
+
escape
(
entries
[
1
])
+
'"
>delete</a> <a href=
"
#
"
id=
"
dialog-link
"
onclick=
"
buttonListener(
\'
'
+
entries
[
1
]
+
'
\'
, this)
"
>QR</a></tr>
\n
'
response
=
response
+
"
</table>
"
#Close the table
if
(
len
(
entriesList
)
==
0
):
response
=
'
you have no shorten links.
'
#If user has no shorten links make this message
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment