Ft admin asset Type threshold notification#329
Open
kenneth051 wants to merge 8 commits intodevelopfrom
Open
Conversation
kmazi
requested changes
Sep 3, 2019
| try: | ||
| super().save(*args, **kwargs) | ||
| if self.previous_assignee is None: | ||
| threshold_data = self.asset.model_number.asset_make.asset_type |
Collaborator
There was a problem hiding this comment.
This variable would be more descriptive if named asset_type. Then you can have asset_type.threshold = ....
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[Finishes #167967311]
What does this PR do?
alerts admins in case the asset type threshold drops below the default threshold
Description of Task to be completed?
Current, we are assigning assets to users and departments without keeping track of the current remaining assets. this PR addresses this issue and if the remaining assets go below the default asset threshold, then admins will be notified via email
How should this be manually tested?
http://127.0.0.1:8000/api/v1/allocationsthen assign an asset to a userAny background context you want to provide?
start by migrating the models. run the command python manage.py migrate to apply the necessary changes.
Make sure in ur
.envfile you set the variableDEFAULT_THRESHOLDto a number for instance 20. then in theassettypemodel edit the fields by giving them a threshold value that we will compare with the DEFAULT_THRESHOLD.set the email fields in your .env and give them values
MAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = " "
EMAIL_HOST_PASSWORD = " "
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_SENDER=" "
after starting the server, make sure you open another terminal tab and run the command
python manage.py qclusterto start theqClusterWhat are the relevant pivotal tracker stories?
https://www.pivotaltracker.com/n/projects/2146417/stories/167967311