Open
Conversation
jbopp
commented
Mar 27, 2020
Author
jbopp
left a comment
There was a problem hiding this comment.
The changes which have been made are commented now.
| 'foundation', | ||
| 'slack', | ||
| 'about', | ||
| 'custom_middleware' |
| 'slack', | ||
| 'about', | ||
| 'custom_middleware' | ||
| 'login_required' |
Author
There was a problem hiding this comment.
...since login is now managed by https://pypi.org/project/django-login-required-middleware/.
| 'login_required' | ||
| ) | ||
|
|
||
| MIDDLEWARE_CLASSES = ( |
| 'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
| 'custom_middleware.middleware.LoginRequiredMiddleware', | ||
| ) | ||
| TEMPLATE_CONTEXT_PROCESSORS=("django.contrib.auth.context_processors.auth", |
|
|
||
| WSGI_APPLICATION = 'DiamondBase.wsgi.application' | ||
|
|
||
| LOGIN_URL = '/login/' |
Author
There was a problem hiding this comment.
Configuration of login_required plugin
| try: return redirect(obj.url()) | ||
| except: pass # If not url method, just return this form | ||
| context = RequestContext(request,{'obj':obj, | ||
| 'obj_fields':fields, |
|
|
||
| if type == 'Sample': | ||
| form.fields["owner"].queryset = User.objects.filter(is_staff=True).order_by('first_name') | ||
| elif type != 'Sample' and type != 'Piece': |
| obj=False | ||
| form='' | ||
| prompt='' | ||
| editable=['Sample','Piece','Action','General','Local','Local_Attachment'] |
| obj.delete() | ||
| try: | ||
| obj.delete() | ||
| except models.ProtectedError: |
Author
There was a problem hiding this comment.
Show proper error message if object cannot be deleted due to on_delete constraint.
| type = Data_Type.objects.get(id = attachID) | ||
| prompt = 'Filenames will go to notes unless a txt file is supplied. The txt file needs <b>one line per file!</b>' | ||
| if request.method == 'POST': | ||
| form=ZipForm(type,request.POST,request.FILES) |
Author
There was a problem hiding this comment.
See sample_database/models.py on how additional parameters are handled now.
jbopp
commented
Mar 27, 2020
Author
jbopp
left a comment
There was a problem hiding this comment.
The changes which have been made are commented now.
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.
DiamondBase is now compatible with Django 3.0.2 and Python 3. Furthermore, Action_Type and Data_Type objects can now be linked to parameters which can be set up dynamically. To make this work, DiamondBase/triggers.sql needs to be incorporated in the SQL database used.