Skip to content

Commit

Permalink
Update entry migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 committed Jul 9, 2024
1 parent 35b4dbb commit 0c6fb39
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 72 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 3.2.25 on 2024-06-09 09:04
# Generated by Django 3.2.25 on 2024-07-09 04:17

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -7,6 +7,7 @@
class Migration(migrations.Migration):

dependencies = [
('lead', '0051_auto_20240625_0509'),
('entry', '0037_merge_20220401_0527'),
]

Expand All @@ -20,10 +21,15 @@ class Migration(migrations.Migration):
name='EntryAttachment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('entry_file_type', models.PositiveSmallIntegerField(choices=[('1', 'XLSX')], default='1')),
('entry_file_type', models.PositiveSmallIntegerField(choices=[(1, 'XLSX'), (2, 'Image')], default=1)),
('file', models.FileField(upload_to='entry/attachment/')),
('file_preview', models.FileField(upload_to='entry/attachment-preview')),
('entry', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='entry.entry')),
('lead_attachment', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='lead.leadpreviewattachment')),
],
),
migrations.AddField(
model_name='entry',
name='entry_attachment',
field=models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='entry.entryattachment'),
),
]
23 changes: 0 additions & 23 deletions apps/entry/migrations/0039_auto_20240609_0933.py

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions apps/entry/migrations/0041_auto_20240621_1149.py

This file was deleted.

2 changes: 1 addition & 1 deletion apps/gallery/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_private_file_url(private_file_module_type: PrivateFileModuleType, id: in
)


def check_private_condifential_level_permission(user, project, level):
def check_private_confidential_level_permission(user, project, level):
permission = PP.get_permissions(project, user)
if PP.Permission.VIEW_ENTRY in permission:
if PP.Permission.VIEW_ALL_LEAD in permission:
Expand Down
4 changes: 2 additions & 2 deletions apps/gallery/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.shortcuts import redirect, get_object_or_404

from gallery.enums import PrivateFileModuleType
from gallery.utils import check_private_condifential_level_permission
from gallery.utils import check_private_confidential_level_permission
from rest_framework import (
views,
viewsets,
Expand Down Expand Up @@ -97,7 +97,7 @@ def get(self, request, module=None, identifier=None, filename=None):
return response.Response({
'error': 'Unauthorized for the content'
}, status.HTTP_403_FORBIDDEN)
if not check_private_condifential_level_permission(user, entry.project, entry.lead.confidentiality):
if not check_private_confidential_level_permission(user, entry.project, entry.lead.confidentiality):
return response.Response({
'error': 'Access Denied'
}, status.HTTP_403_FORBIDDEN)
Expand Down

0 comments on commit 0c6fb39

Please sign in to comment.