Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
feudalBackend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
feudal
feudalBackend
Commits
805283cf
Commit
805283cf
authored
Sep 25, 2020
by
lukas.burgey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--wip--
parent
9c7b38da
Pipeline
#110856
passed with stage
in 1 minute and 23 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
feudal/backend/models/deployments.py
feudal/backend/models/deployments.py
+3
-3
feudal/backend/models/users.py
feudal/backend/models/users.py
+2
-8
No files found.
feudal/backend/models/deployments.py
View file @
805283cf
...
...
@@ -228,7 +228,7 @@ def inform_states_about_deletion(sender, instance=None, **kwargs):
_
=
kwargs
states
=
list
(
instance
.
states
.
all
())
LOGGER
.
debug
(
instance
.
msg
(
'
Deleted deployment still has states
: {}'
.
format
(
states
)))
LOGGER
.
debug
(
instance
.
msg
(
'
Informing states about my deletion
: {}'
.
format
(
states
)))
instance
.
state_target
=
NOT_DEPLOYED
instance
.
save
()
...
...
@@ -490,8 +490,8 @@ class DeploymentState(models.Model):
# state_target -> state -> transition
state_transitions
=
{
DEPLOYED
:
{
DEPLOYED
:
self
.
publish_to_client
,
# the user updated the answers
FAILED
:
self
.
publish_to_client
,
# maybe changed answers solve the problem
DEPLOYED
:
[
DEPLOYMENT_PENDING
,
self
.
publish_to_client
],
# the user updated the answers
FAILED
:
[
DEPLOYMENT_PENDING
,
self
.
publish_to_client
],
# maybe changed answers solve the problem
QUESTIONNAIRE
:
[
DEPLOYMENT_PENDING
,
self
.
publish_to_client
],
# answers were needed for deploying
},
NOT_DEPLOYED
:
{
...
...
feudal/backend/models/users.py
View file @
805283cf
...
...
@@ -456,11 +456,7 @@ class User(AbstractUser):
def
delete
(
self
,
using
=
None
,
keep_parents
=
False
):
if
self
.
user_type
==
self
.
TYPE_CHOICE_USER
:
LOGGER
.
info
(
'Deleting User %s'
,
self
)
# TODO
# these deletions are a hack. django should (TM) be able to delete them itself
# but there seems to be a bug
LOGGER
.
info
(
self
.
msg
(
'Preparing user deletion'
))
self
.
_delete_deployments
()
...
...
@@ -468,9 +464,7 @@ class User(AbstractUser):
for
key
in
self
.
ssh_keys
.
all
():
key
.
delete_key
()
for
state
in
self
.
states
.
all
():
state
.
publish_to_client
()
LOGGER
.
info
(
self
.
msg
(
'Deleting right now'
))
super
().
delete
(
using
,
keep_parents
)
def
add_key
(
self
,
key
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment