-
Notifications
You must be signed in to change notification settings - Fork 14
Ft admin asset Type threshold notification #329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kenneth051
wants to merge
8
commits into
develop
Choose a base branch
from
ft-admin-assettype-threshold-notofication-167967311
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ft admin asset Type threshold notification #329
kenneth051
wants to merge
8
commits into
develop
from
ft-admin-assettype-threshold-notofication-167967311
Conversation
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
kmazi
requested changes
Sep 3, 2019
@@ -542,6 +545,13 @@ def save(self, *args, **kwargs): | |||
self.previous_assignee = None | |||
try: | |||
super().save(*args, **kwargs) | |||
if self.previous_assignee is None: | |||
threshold_data = self.asset.model_number.asset_make.asset_type |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable would be more descriptive if named asset_type
. Then you can have asset_type.threshold = ....
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/allocations
then 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
.env
file you set the variableDEFAULT_THRESHOLD
to a number for instance 20. then in theassettype
model 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 qcluster
to start theqCluster
What are the relevant pivotal tracker stories?
https://www.pivotaltracker.com/n/projects/2146417/stories/167967311