Repository: pypi/warehouse

Issue:
Display file and total project size limits on project settings page
We should display the current file size limit (`Project.upload_limit`) and total size limit (`Project.total_size_limit`)
on the project settings page for all projects, with external links to https://pypi.org/help/#file-size-limit and https://pypi.org/help/#project-size-limit, respectively.

---

**Good First Issue**: This issue is good for first time contributors. If you've already contributed to Warehouse, work on [another issue without this label](https://github.com/pypa/warehouse/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+-label%3A%22good+first+issue%22) instead. If there is not a corresponding pull request for this issue, it is up for grabs. For directions for getting set up, see our [Getting Started Guide](https://warehouse.pypa.io/development/getting-started/).

If you are working on this issue and have questions, feel free to ask them here, in the [`#pypa-dev` chat channel on Freenode](https://webchat.freenode.net/?channels=%23pypa-dev), or on the [distutils-sig.python.org mailing list](https://mail.python.org/mailman3/lists/distutils-sig.python.org/).

**Screenshot Required**: *If your pull request makes a visual change*, include a screenshot of your update. This helps our team give you feedback faster.



Discussion:
Hey, @di I have updated the template for this. Which file do I have to update for updating the text value inside the anchor tag?
Re-opening this, I missed that in #8221 it is showing `0 bytes` instead of the default values when a limit is not set.

@imsahil007, can you take a look?
> Re-opening this, I missed that in #8221 it is showing `0 bytes` instead of the default values when a limit is not set.
> 
> @imsahil007, can you take a look?

I missed that! I checked the values only after updating the limits. I will look into that.
![Screenshot from 2020-07-08 12-14-13](https://user-images.githubusercontent.com/35963992/86886484-a29e2000-c114-11ea-9b02-04c9f593d476.png)
I think this will close the issue for now.
The default values in the database are set to 0. Even in the admin panel if the value is not there we are printing the warehouse.forklift constants MAX_FILESIZE and so... I used the same approach.


Resolving patch:
diff --git a/warehouse/manage/views.py b/warehouse/manage/views.py
--- a/warehouse/manage/views.py
+++ b/warehouse/manage/views.py
@@ -44,6 +44,7 @@
     send_unyanked_project_release_email,
     send_yanked_project_release_email,
 )
+from warehouse.forklift.legacy import MAX_FILESIZE, MAX_PROJECT_SIZE
 from warehouse.macaroons.interfaces import IMacaroonService
 from warehouse.manage.forms import (
     AddEmailForm,
@@ -915,7 +916,11 @@ def _key(project):
     has_translations=True,
 )
 def manage_project_settings(project, request):
-    return {"project": project}
+    return {
+        "project": project,
+        "MAX_FILESIZE": MAX_FILESIZE,
+        "MAX_PROJECT_SIZE": MAX_PROJECT_SIZE,
+    }
 
 
 def get_user_role_in_project(project, user, request):


Test patch:
diff --git a/tests/unit/manage/test_views.py b/tests/unit/manage/test_views.py
--- a/tests/unit/manage/test_views.py
+++ b/tests/unit/manage/test_views.py
@@ -28,6 +28,7 @@
 
 from warehouse.accounts.interfaces import IPasswordBreachedService, IUserService
 from warehouse.admin.flags import AdminFlagValue
+from warehouse.forklift.legacy import MAX_FILESIZE, MAX_PROJECT_SIZE
 from warehouse.macaroons.interfaces import IMacaroonService
 from warehouse.manage import views
 from warehouse.packaging.models import (
@@ -2287,7 +2288,11 @@ def test_manage_project_settings(self):
         request = pretend.stub()
         project = pretend.stub()
 
-        assert views.manage_project_settings(project, request) == {"project": project}
+        assert views.manage_project_settings(project, request) == {
+            "project": project,
+            "MAX_FILESIZE": MAX_FILESIZE,
+            "MAX_PROJECT_SIZE": MAX_PROJECT_SIZE,
+        }
 
     def test_delete_project_no_confirm(self):
         project = pretend.stub(normalized_name="foo")