Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
teknikattan-scoring-system
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddd96-grupp1
teknikattan-scoring-system
Commits
d28f15c6
Commit
d28f15c6
authored
4 years ago
by
Carl Schönfelder
Browse files
Options
Downloads
Patches
Plain Diff
#18
: Removed add_user in app
parent
752ba370
No related branches found
No related tags found
1 merge request
!23
Resolve "Add db-tests"
Pipeline
#35996
passed
4 years ago
Stage: setup
Stage: test
Stage: report
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/app/__init__.py
+0
-10
0 additions, 10 deletions
server/app/__init__.py
server/app/database/populate.py
+1
-1
1 addition, 1 deletion
server/app/database/populate.py
with
1 addition
and
11 deletions
server/app/__init__.py
+
0
−
10
View file @
d28f15c6
...
...
@@ -29,16 +29,6 @@ def create_app(config_name="configmodule.DevelopmentConfig"):
return
app
def
add_user
(
email
,
plaintext_password
,
role
,
city
):
from
app.database.models
import
City
,
Role
,
User
item_role
=
Role
.
query
.
filter_by
(
name
=
role
).
first
()
item_city
=
City
.
query
.
filter_by
(
name
=
city
).
first
()
user
=
User
(
email
,
bcrypt
.
generate_password_hash
(
plaintext_password
),
item_role
.
id
,
item_city
.
id
)
db
.
session
.
add
(
user
)
db
.
commit
()
def
identity
(
payload
):
user_id
=
payload
[
"
identity
"
]
return
models
.
User
.
query
.
filter_by
(
id
=
user_id
)
...
...
This diff is collapsed.
Click to expand it.
server/app/database/populate.py
+
1
−
1
View file @
d28f15c6
from
app
import
add_user
,
db
from
app
import
db
from
app.database.controller
import
add_user
from
app.database.models
import
City
,
MediaType
,
QuestionType
,
Role
...
...
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