Commit 31a5a688 authored by Kacprzak, Izabella's avatar Kacprzak, Izabella
Browse files

Created an admin user that cant be deleted [IK, BG]

parent 6768b3c7
Pipeline #202774 passed with stages
in 2 minutes and 13 seconds
......@@ -90,6 +90,9 @@ def update_user(username):
@user.route('/users/<username>', methods=['DELETE'])
def delete_user(username):
if username == "jaimeaguilera":
return ''
entry = User.query.get(username)
DB.delete(entry)
return ''
......
{
"files": {
"main.css": "/static/react/css/main.dd5917b5.chunk.css",
"main.js": "/static/react/js/main.66bb16bd.chunk.js",
"main.js.map": "/static/react/js/main.66bb16bd.chunk.js.map",
"main.js": "/static/react/js/main.dd2a572a.chunk.js",
"main.js.map": "/static/react/js/main.dd2a572a.chunk.js.map",
"runtime-main.js": "/static/react/js/runtime-main.d0ba4578.js",
"runtime-main.js.map": "/static/react/js/runtime-main.d0ba4578.js.map",
"js/2.3bffcab4.chunk.js": "/static/react/js/2.3bffcab4.chunk.js",
"js/2.3bffcab4.chunk.js.map": "/static/react/js/2.3bffcab4.chunk.js.map",
"js/2.49f267ca.chunk.js": "/static/react/js/2.49f267ca.chunk.js",
"js/2.49f267ca.chunk.js.map": "/static/react/js/2.49f267ca.chunk.js.map",
"js/3.c9f8f6ff.chunk.js": "/static/react/js/3.c9f8f6ff.chunk.js",
"js/3.c9f8f6ff.chunk.js.map": "/static/react/js/3.c9f8f6ff.chunk.js.map",
"../../templates/index.html": "/static/react/../../templates/index.html",
"css/main.dd5917b5.chunk.css.map": "/static/react/css/main.dd5917b5.chunk.css.map",
"js/2.3bffcab4.chunk.js.LICENSE.txt": "/static/react/js/2.3bffcab4.chunk.js.LICENSE.txt"
"js/2.49f267ca.chunk.js.LICENSE.txt": "/static/react/js/2.49f267ca.chunk.js.LICENSE.txt"
},
"entrypoints": [
"js/runtime-main.d0ba4578.js",
"js/2.3bffcab4.chunk.js",
"js/2.49f267ca.chunk.js",
"css/main.dd5917b5.chunk.css",
"js/main.66bb16bd.chunk.js"
"js/main.dd2a572a.chunk.js"
]
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/react/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/static/react/logo192.png"/><link rel="manifest" href="/static/react/manifest.json"/><title>React App</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.dd5917b5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,u,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)u=i[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return a.push.apply(a,l||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(a.splice(r--,1),e=u(u.s=t[0]))}return e}var n={},o={1:0},a=[];function u(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,u),t.l=!0,t.exports}u.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"js/"+({}[e]||e)+"."+{3:"c9f8f6ff"}[e]+".chunk.js"}(e);var c=new Error;a=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(r)},u.m=e,u.c=n,u.d=function(e,r,t){u.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,r){if(1&r&&(e=u(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)u.d(t,n,function(r){return e[r]}.bind(null,n));return t},u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,"a",r),r},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.p="/static/react/",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="/static/react/js/2.3bffcab4.chunk.js"></script><script src="/static/react/js/main.66bb16bd.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/static/react/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/static/react/logo192.png"/><link rel="manifest" href="/static/react/manifest.json"/><title>React App</title><script>window.token="{{DRP_token}}"</script><link href="/static/react/css/main.dd5917b5.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(e){function r(r){for(var n,u,i=r[0],c=r[1],l=r[2],s=0,p=[];s<i.length;s++)u=i[s],Object.prototype.hasOwnProperty.call(o,u)&&o[u]&&p.push(o[u][0]),o[u]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(f&&f(r);p.length;)p.shift()();return a.push.apply(a,l||[]),t()}function t(){for(var e,r=0;r<a.length;r++){for(var t=a[r],n=!0,i=1;i<t.length;i++){var c=t[i];0!==o[c]&&(n=!1)}n&&(a.splice(r--,1),e=u(u.s=t[0]))}return e}var n={},o={1:0},a=[];function u(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,u),t.l=!0,t.exports}u.e=function(e){var r=[],t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise((function(r,n){t=o[e]=[r,n]}));r.push(t[2]=n);var a,i=document.createElement("script");i.charset="utf-8",i.timeout=120,u.nc&&i.setAttribute("nonce",u.nc),i.src=function(e){return u.p+"js/"+({}[e]||e)+"."+{3:"c9f8f6ff"}[e]+".chunk.js"}(e);var c=new Error;a=function(r){i.onerror=i.onload=null,clearTimeout(l);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+a+")",c.name="ChunkLoadError",c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:i})}),12e4);i.onerror=i.onload=a,document.head.appendChild(i)}return Promise.all(r)},u.m=e,u.c=n,u.d=function(e,r,t){u.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.t=function(e,r){if(1&r&&(e=u(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(u.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)u.d(t,n,function(r){return e[r]}.bind(null,n));return t},u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,"a",r),r},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.p="/static/react/",u.oe=function(e){throw console.error(e),e};var i=this["webpackJsonpinaglobe-dashboard"]=this["webpackJsonpinaglobe-dashboard"]||[],c=i.push.bind(i);i.push=r,i=i.slice();for(var l=0;l<i.length;l++)r(i[l]);var f=c;t()}([])</script><script src="/static/react/js/2.49f267ca.chunk.js"></script><script src="/static/react/js/main.dd2a572a.chunk.js"></script></body></html>
\ No newline at end of file
import ProjectList from './ProjectList'
import PersonalToDo from './PersonalToDo'
import useFetch from './useFetch'
import useToken from './useToken';
const Home = () => {
const {data: projects, errorProjects, isPendingProjects} = useFetch("/projects")
const {data: todos, errorTodos, isPendingTodos} = useFetch("/todos")
const {setToken, token} = useToken();
return (
<div className="home">
......@@ -17,7 +19,7 @@ const Home = () => {
</div>
<div className="homeTodos">
{ isPendingTodos && <h2>Loading...</h2> }
{ todos && <PersonalToDo todos={todos.filter(todo => todo.username === "john34")} title="Personal ToDo items"/> }
{ todos && <PersonalToDo todos={todos.filter(todo => todo.username === token)} title="Personal ToDo items"/> }
</div>
</div>
......
......@@ -47,7 +47,7 @@ const User = () => {
<p>{user.interests}</p>
</div> }
{ user && <button onClick={handleRemove}>Delete user</button> }
{ user && username != "jaimeaguilera" && <button onClick={handleRemove}>Delete user</button> }
{ user && <Link to={`/edit-user/${username}`} className="edit-user-button">Edit details</Link> }
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment